[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Error processing FO output from docbook-xsl
On Wed, Oct 08, 2003 at 03:16:05PM -0400, Jeff Beal wrote: > I can see where the confusion comes from. Why does the definition of the > PITarget exclude PITargets that match (('X'|'x')('M'|'m')('L'|'l')) if that > is already implicit from the use of the 'Name' production? (That's a > rhetorical question -- no need to answer.) It's not rethorical, it's very practical, there are good reasons for both rules, and since there is some confusion around this issue it's better to try to give an explanation, it's not evilness it's just pure engineering. "xml" prefix in name is reserved, it does not lead to an error. You get a warning from xmllint, the parsing does not fail, it still processes the document. On the other hand having <?xml bad pi?> is a well formedness error: paphio:~/XML -> cat tst.xml <!-- something before --> <?xml bad pi?> <doc/> paphio:~/XML -> xmllint tst.xml tst.xml:2: parser error : XML declaration allowed only at the start of the document <?xml bad pi?> ^ paphio:~/XML -> cat tst2.xml <!-- something before --> <?xmlspy bad pi?> <doc/> paphio:~/XML -> xmllint tst2.xml tst2.xml:2: parser warning : xmlParsePITarget: invalid name prefix 'xml' <?xmlspy bad pi?> ^ <?xml version="1.0"?> <!-- something before --> <?xmlspy bad pi?> <doc/> paphio:~/XML -> In the second case it's an use of a reserved word, xmllint doesn't handle what could be an unknown extension to XML, so you just get a warning. In the first case, it's a well formedness error and libxml2 doesn't generate a tree for the document. I suppose the use of "xml" case insensitive for PI names has been made a Well Formedness error to be 100% sure that they won't be mistaken for XML Declarations (the optional <?xml...?> construct at the beginning of an XML document). Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]