Schematron for checking xml:id?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Schematron for checking xml:id?

Chris Lilley

Hello public-xml-id,

Following this thread

which demonstrates that (since Relax-NG does not modify the infoset) xl:id should be declared as NCNAME in a RelaxNG schema, I was wondering whether Schematron could be used to check various aspects of IDness? In particular I was wondering if anyone had already done it :)

SVG, which introduced xml:id to a language that already had @id of type ID,

tries to give guidance on document authoring and document processing in the case that both attributes are used in the same document

Since these are co-constraints, it looks as if Schamatron could help in checking this:

a) warn if an element has both @id and @xml:id with different values
b) check ID uniqueness by first converting @id to @xml:id for any element that has @id and does not have @xml:id, then using an xml:id-aware processor

Does this seem like a feasible approach?

 Chris Lilley                    mailto:[hidden email]
 Technical Director, Interaction Domain
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG