Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Proper successor for QXmlSchemaValidator?
QtWS25 Last Chance

Proper successor for QXmlSchemaValidator?

Scheduled Pinned Locked Moved Solved General and Desktop
xmlqxmlstreamwriteqxmlschemaxml patternc++
6 Posts 4 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robin Glattauer
    wrote on last edited by Robin Glattauer
    #1

    Hi,

    I am using QXmlStreamReader (https://doc.qt.io/qt-5/qxmlstreamreader.html) and QXmlStreamWriter for a while now since the Qt documentation discourages to use QDom stuff (https://doc.qt.io/qt-5/qtxml-index.html), I am quite happy with it, but now I would like to profit from xml schemata to have a better control of what happens with my xml files. Naturally I would use the QXmlSchemaValidator (https://doc.qt.io/qt-5/qxmlschemavalidator.html) and its related classes to handle that, but it seems that the Xml pattern module has been set to deprecated for Qt 5.13 (https://wiki.qt.io/New_Features_in_Qt_5.13 ). Since I intend to use that code for a while I would prefer to use classes which will not get removed in the foreseeable future, but I do not find anything in the documentation.

    Therefore my question to the specialists: what is a proper Qt way to handle Xml Schemata and such in 2019? Many thanks in advance for your help!

    1 Reply Last reply
    1
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      I am curious as to what will happen here as well. I use QXmlQuery to parse my xml data. The other solutions in the wild are huge behemoths of code I would rather that include in my project. I don't know of any lightweight xslt processors out there.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        That a question better asked on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • R Offline
          R Offline
          Robin Glattauer
          wrote on last edited by
          #4

          Hi,

          thanks for your answers, I will try the mailing list then...

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Robin Glattauer
            wrote on last edited by Robin Glattauer
            #5

            A colleague asked for me on the mailing list and that was the answer:

            regarding the 'deprecated' state of XmlPatterns: There wont be an further development for this module, but I also doubt that it will be removed before Qt 6. So as long as you're using Qt 5 you're safe to use XmlPatterns. Qt 6 might be still 2 years away, and as you're using it professionally, I assume that you'll probably wait at least till the release of Qt 6.1 (or even longer) anyway before upgrading your project to it. Until then there might be another Qt (conforming) solution to the problem.

            So in my opinion you've got 2 options (depending on the scope and lifecycle of your project):
            a) use the Xml Schema related classes from the XmlPatterns module and worry about it going away (much) later, and maybe even have a Qt (conforming) solution by then, or
            b) use an external library like CodeSynthesis XSD or something similar and worry about their API changes and usage and naming patterns that differ from Qt's patterns etc.

            IMHO using the Qt modules while they are still available is usually the better option.

            [[by Yves Maurischat]]

            I hope that helps other developers with similar questions. I mark this as solved in the sense that there is some sort of answer here, although maybe it's not completely satisfying.

            1 Reply Last reply
            4
            • W Offline
              W Offline
              Whaley2K
              Banned
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved