Page 1 of 1

enabling id/idref validation for relaxng schemas

Posted: Tue Oct 07, 2008 3:58 pm
by mgarrish
It appears that the -i option for jing has been enabled by default when validating relaxng schemas through onvdl (referencing errors are not reported, but id and idref values are checked for conformance). The only way I can get bad references to be reported is to call jing directly.

If I'm not wrong about something that should be obvious (which is always a good chance), is there any way to enable the validation? I can mimic the checks by adding a schematron schema, but it's a painfully slow option.

Copying below a minimal set of files that can be used to exhibit the issue:

====test.xml====

<?xml version="1.0" encoding="utf-8"?>
<master xmlns="http://test/master">
<noteref ref="en999">1</noteref>
<note id="en1">1. Central Intelligence Agency, Kubark Counterintelligence Interrogation, July 1963, 49-50, 76-77.</note>
</master>



====idref.nvdl====

<?xml version="1.0" encoding="utf-8"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
startMode="doc">

<mode name="doc">
<namespace ns="http://test/master">
<validate schema="master.rnc" schemaType="application/x-rnc"/>
</namespace>
</mode>

</rules>



====master.rnc===

default namespace = "http://test/master"

namespace xml = "http://www.w3.org/XML/1998/namespace"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"


start = element master {
(noteref, note)+
}


note = element note {
attribute id { xsd:ID },
text
}

noteref = element noteref {
attribute ref { xsd:IDREF },
text
}

Re: enabling id/idref validation for relaxng schemas

Posted: Tue Nov 04, 2008 2:06 pm
by george
Thanks for reporting this. It seems indeed an issue that even the option is enabled by default as you noted when the Relax NG schema is referred from NVDL that option is not honored. I logged it and as we will have progress on it I will let you now.
Ideally I believe that should be an option for the validate action in the NVDL script.

Best Regards,
George

Re: enabling id/idref validation for relaxng schemas

Posted: Tue Jun 01, 2010 2:48 pm
by george
While starting to work on this I see that it is possible to enable the ID/IDREF checking with an option. The NVDL script needs to be modified as below:

Code: Select all


<?xml version="1.0" encoding="utf-8"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" startMode="doc">

<mode name="doc">
<namespace ns="http://test/master">
<validate schema="master.rnc" schemaType="application/relax-ng-compact-syntax">
<option name="http://www.thaiopensource.com/validate/check-id-idref"/>
</validate>
</namespace>
</mode>

</rules>
That makes the issue invalid.
There is also an issue logged on Jing to turn off by default the ID/IDREF checking so the NVDL validation will be consistent with that
http://code.google.com/p/jing-trang/issues/detail?id=36

Best Regards,
George