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

QXmlQuery is removing non-breaking spaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.8, 5.9, 5.10
    • XML: QtXmlPatterns
    • None
    • * Ubuntu 14 (Mint 17)
       * Windows 10

    Description

      source.xml

      <document>
        <title>this is a document</title>
        <content>
          <div>&#xA0;</div>
        </content>
      </document>

      main.cpp

      #include <QtCore/QCoreApplication>
      #include <QFile>
      #include <QtXmlPatterns/QXmlQuery>
      #include <QDebug>
      int main(int argc, char *argv[])
      {
        QCoreApplication a(argc, argv);
        Qfile file("source.xml");
        file.open(QIODevice::ReadOnly);
        
        QXmlQuery query;
        query.setFocus(&file);
        query.setQuery("document/content");
       
        QString result;
        qDebug() << result;
      }
      

      Expected output

      <div>&#xA0;</div>

      Actual output

      <div />

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sjones_amh.net.au Stuart Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes