After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782520 - Wrong warning/error about "colons are forbidden from PI names" (Debian Bug #862322)
Wrong warning/error about "colons are forbidden from PI names" (Debian Bug #8...
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: parser
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2017-05-11 13:48 UTC by Andre Naujoks
Modified: 2021-07-05 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libxml2_patch_colons_in_pinames.patch (407 bytes, patch)
2017-05-11 13:48 UTC, Andre Naujoks
none Details | Review
test.xml (28 bytes, text/xml)
2017-05-11 13:49 UTC, Andre Naujoks
  Details

Description Andre Naujoks 2017-05-11 13:48:39 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
Comment 1 Andre Naujoks 2017-05-11 13:49:32 UTC
Created attachment 351644 [details]
test.xml
Comment 2 Nick Wellnhofer 2019-11-02 16:45:26 UTC
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.
Comment 3 GNOME Infrastructure Team 2021-07-05 13:22:22 UTC
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.