Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25832

XQuery implementation outputs CDATA sections as escaped XML instead of raw data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5: Not important P5: Not important
    • 5.15
    • 4.7.4, 4.8.0
    • XML: QtXmlPatterns
    • None
    • Qt SDK 1.2.1

      XQuery on CDATA sections returns result as escaped XML text instead of original raw data.

      Example code (see complete project attached) :

      QXmlQuery xQuery;
      xQuery.setQuery("doc('test.xml')/xml/string()");
      QString result;
      xQuery.evaluateTo(&result);
      qDebug() << "Result = " << result;

      With the following input test.xml file :

      <xml>
      <![CDATA[<tag>test</tag>]]>
      </xml>

      returns escaped output:
      &lt;tag&gt;test&lt;/tag&gt;

      instead of the correct output :
      <tag>test</tag>

      XQuery engine should leave the CDATA section untouched without any extra encoding because that's what CDATA sections are meant for.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            axelspoerl Axel Spoerl
            remy_david Rémy DAVID
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes