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 741444 - Combining XML_PARSE_NOCDATA with XML Schema causes loss of CDATA sections.
Combining XML_PARSE_NOCDATA with XML Schema causes loss of CDATA sections.
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-12 14:38 UTC by Björn Persson
Modified: 2021-07-05 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reproducer (2.79 KB, text/x-csrc)
2014-12-12 14:38 UTC, Björn Persson
Details

Description Björn Persson 2014-12-12 14:38:08 UTC
Created attachment 292613 [details]
reproducer

When the XML Reader API is used with XML_PARSE_NOCDATA and XML Schema validation, then LibXML2 appears to drop CDATA sections. The text it returns is as if the CDATA sections were empty.

The attached program works on this XML code:

"<test>one <![CDATA[two]]> three</test>"

It parses this code three times with different combinations of validation and NOCDATA, and lists the nodes it encounters. It should find the same content whether validation is enabled or not. This is the actual output:

validating, not decoding CDATA:
  start tag
  text: "one "
  CDATA: "two"
  text: " three"
  end tag

not validating, decoding CDATA:
  start tag
  text: "one two three"
  end tag

validating, decoding CDATA:
  start tag
  text: "one  three"
  end tag

1 errors detected
Comment 1 zhouzhongyuan 2019-08-22 11:33:03 UTC
I tried to validate it with the "xmllint" program, using the --nocdata --schema option. The result of the operation is ok. So, this error may not be a bug in libxml2, more likely a program logic problem
Comment 2 GNOME Infrastructure Team 2021-07-05 13:27:19 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.