enabling id/idref validation for relaxng schemas

Issues related with the oNVDL implementation of NVDL.
mgarrish
Posts: 3

enabling id/idref validation for relaxng schemas

Tue Oct 07, 2008 3:58 pm

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
}
george
Site Admin
Posts: 2099

Re: enabling id/idref validation for relaxng schemas

Tue Nov 04, 2008 2:06 pm

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
George Cristian Bina
george
Site Admin
Posts: 2099

Re: enabling id/idref validation for relaxng schemas

Tue Jun 01, 2010 2:48 pm

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
George Cristian Bina

Return to “oNVDL Related Issues”

Who is online

Users browsing this forum: No registered users and 0 guests