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

QXmlQuery passes down xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attribute while evaluateing XPath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.7.0
    • XML: QtXmlPatterns

      a) Take this XML tree
      <?xml version="1.0" encoding="UTF-8" ?>
      <Request xsi:noNamespaceSchemaLocation="RSGuiTesterRequest.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Header>
      <ProtocollVersion Version="1.0.0"/>
      <SequenceID ID="1"/>
      </Header>
      <Body>
      <Capture>
      <MouseClick>
      <StandardData/>
      </MouseClick>
      </Capture>
      </Body>
      </Request>
      b) Do XPath evaluation on any node like for example:
      QString m_qsMessage = "...."; // Replace ... by the above XML tree
      QXmlQuery m_qxmlqProtokollQuery;
      QBuffer m_qBQueryDevice;
      QString m_qsInterpretedResult;

      m_qBQueryDevice.setData(m_qsMessage.toUtf8());
      m_qBQueryDevice.open(QIODevice::ReadOnly);

      m_qxmlqProtokollQuery.bindVariable("inputDocument", &m_qBQueryDevice);
      m_qxmlqProtokollQuery.setQuery("doc($inputDocument)/Request/Body/Capture/StandardData");
      m_qxmlqProtokollQuery.evaluateTo(&m_qsInterpretedResult);

      >>> evaluates to: <StandardData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

      I would have expected <StandardData/>

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

            pamatila Pasi Matilainen (Inactive)
            gerhard w schuster Gerhard Walter Schuster
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes