GNOME Bugzilla – Bug 782520
Wrong warning/error about "colons are forbidden from PI names" (Debian Bug #862322)
Last modified: 2021-07-05 13:22:22 UTC
Created attachment 351643 [details] [review] libxml2_patch_colons_in_pinames.patch Hi. I was asked to report this bug upstream. Since it might have side effects, which I cannot rule out. The following is the text from the original report: When parsing an XML Document, libxml2 wrongly reports an error (seemingly without further consequences) about colons not being allowed in Processing-Instruction names. This is not true. The XML Specification (https://www.w3.org/TR/REC-xml/#sec-pi and https://www.w3.org/TR/REC-xml/#NT-Name) explicitly allows a colon (':') as part of a PITarget, which is a Name in the XML specifications terms. The last Version of the XML Specification, where a colon was not allowed in a processing instruction name is over 20 years old and I think can be safely ignored by now: https://www.w3.org/TR/WD-xml-lang-970331#NT-Name Attached (in the next reply to this bug) is a test document (test.xml), which triggers the warning, when used for example with xmlstarlet like this: $ xmlstarlet fo test.xml test.xml:2.8: colons are forbidden from PI names 'pi:pi' <?pi:pi pi?> ^ <?xml version="1.0"?> <root> <?pi:pi pi?> </root> Also attached is a patch (libxml2_patch_colons_in_pinames.patch), that removes the bit of code from libxml2, that triggers the message. I am not sure about the side effects of the removed function-call, but from the comments in the code it seems it should have aborted processing. It specifically states for xmlNsErr: "Handle a fatal parser error, i.e. violating Well-Formedness constraints". However it does not really abort, which might warrant another bug report. Regards Andre
Created attachment 351644 [details] test.xml
This is because in namespace-well-formed documents, colons aren't allowed in PI targets. See https://www.w3.org/TR/REC-xml-names/#Conformance There's currently no way to disable namespace awareness.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.