GNOME Bugzilla – Bug 130216
xmllint processes anyName except nsName incorrectly
Last modified: 2009-08-15 18:40:50 UTC
xmllint: using libxml version 20604 compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude Unicode Regexps Automata Schemas fails to validate <stylesheet xmlns:foo="http://example.com/foo" xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> <template> <foo:x a="b"/> </template> </stylesheet> against <grammar xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ns="http://www.w3.org/1999/XSL/Transform" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-dat atypes"> <start> <element name="stylesheet"> <attribute name="version"><text/></attribute> <zeroOrMore> <ref name="template.element"/> </zeroOrMore> </element> </start> <define name="template.element"> <element name="template"> <ref name="template.model"/> </element> </define> <define name="template.model"> <zeroOrMore> <choice> <ref name="template.element"/> <ref name="literal-result-element"/> <text/> </choice> </zeroOrMore> </define> <define name="literal-result-element"> <element> <anyName> <except> <nsName/> </except> </anyName> <ref name="literal-result-element.atts"/> <ref name="template.model"/> </element> </define> <define name="literal-result-element.atts"> <zeroOrMore> <choice> <attribute> <anyName> <except> <nsName/> </except> </anyName> <data type="string"/> </attribute> </choice> </zeroOrMore> </define> </grammar> complaining, that /home/dvd/work/PreTI/CImpl/admon.xsl:5: element x: Relax-NG validity error : Did not expect element x there /home/dvd/work/PreTI/CImpl/admon.xsl fails to validate
My apologies for the rather long time before this problem was resolved, but it turned out to be quite complex. In fact, it had nothing to do with "anyName except nsName", but rather with the manner in which the recursive defines were applied. The fix was to the module relaxng.c, and has already been committed to CVS. It will, of course, appear in the next release of the library (2.6.9). Thanks for the report - it was very helpful. Bill
This should be closed by release 2.6.9, thanks, Daniel