metanorma/metanorma-model-iso

Failing to compile with xmllint

paolobrasolin opened this issue · 3 comments

I'm trying to validate this XML document

<?xml version="1.0" encoding="UTF-8"?>
<iso-standard xmlns="http://riboseinc.com/isoxml">
</iso-standard>

against the isostandard.rng schema (from master at edd2fcc) using xmllint:

$ xmllint test/main--iso.xml --relaxng metanorma-model-iso/grammars/isostandard.rng
metanorma-model-iso/grammars/isostandard.rng:3: element include: Relax-NG parser error : xmlRelaxNG: include metanorma-model-iso/grammars/isodoc.rng has a define organization but not the included grammar
metanorma-model-iso/grammars/isostandard.rng:3: element include: Relax-NG parser error : xmlRelaxNG: include metanorma-model-iso/grammars/isodoc.rng has a define bdate but not the included grammar
metanorma-model-iso/grammars/biblio.rng:261: element define: Relax-NG parser error : Some defines for organization needs the combine attribute
metanorma-model-iso/grammars/biblio.rng:676: element define: Relax-NG parser error : Some defines for bdate needs the combine attribute
Relax-NG schema metanorma-model-iso/grammars/isostandard.rng failed to compile
<?xml version="1.0" encoding="UTF-8"?>
<iso-standard xmlns="http://riboseinc.com/isoxml">
</iso-standard>

Apparently the schema fails to compile due to some internal inconsistencies.
Is it true or am I using the wrong tool?

I haven't used xmllint. I have not seen those errors before (I use jing-trang in the gems).

In both instances, the grammar is redefining the term from the inherited grammar (biblio), rather than combining it. This is supposed to be legal, according to https://relaxng.org/compact-tutorial-20030326.html §9.4 = https://relaxng.org/tutorial-20011203.html#IDAVEZR.

I don't really know what I'm doing here, but I suspect that in this instance, I've done the right thing, and xmllint isn't navigating deep RelaxNG dependencies properly. (isostandard < isodoc < biblio; note that the xmllint error flag can't link the definition in isostandard with that in biblio.)

I'm not seeing obvious confirmation of this online, but in the first instance, could you try parsing this with jing instead of xmllint? Yes, I hate Java dependencies too, but I do at least know that Jing works as expected here...

I'm closing this.

Thanks @opoudjis.

I can confirm Jing version 20091111 loads the schema just fine.

For the record: I haven't solved the issue with xmllint. I simply opted for an alternate transformation flow not involving this XML schema.