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. Which is best for parsing in Qt???
Forum Updated to NodeBB v4.3 + New Features

Which is best for parsing in Qt???

Scheduled Pinned Locked Moved General and Desktop
9 Posts 6 Posters 5.1k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    TobbY
    wrote on last edited by
    #1
    1. QXmlStreanreader
    2. Qt dom parser
    3. Qt sax parser

    which is fastest and occupy less memory.**
    if there any other please provide????

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      What are exactly your requirements? Sounds like a question from somebody who has never used a XML parser.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • P Offline
        P Offline
        privet
        wrote on last edited by
        #3

        Sax is the fastest and uses less memory.
        Disadvantage of sax-parsers: callback-based. So, you aren't able to "walk through" the DOM several times.

        The DOM-model uses more memory but more comfortable...

        A fourth framework you're not mentioned: libxml2 (not Qt, but C++)

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          I really like the QXmlStream* APIs. They still use much less memory than QDOM since they are incremental like SAX2 but do not require a load of callbacks to be registered.

          It is still easy with QXmlStreamReader to recurse into specialised functions for each sub-section of your XML document.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            It really all depends on your use case, and you are not telling us about that. Personally, I use the QXmlStream* API most nowadays.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              privet
              wrote on last edited by
              #6

              Take care: some important entities aren't supported by the Qt XML parsers.
              See: http://bugreports.qt.nokia.com/browse/QTBUG-6610
              (see comment "No, we don't support those entities at all")

              If you need a really high-end xml parser with entities and DTD-support, than libxml2 is the best (and the most complicated) solution.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sigrid
                wrote on last edited by
                #7

                Also, note that the QtXml module is considered done and that QXmlStreamReader and QXmlStreamWriter are recommended to use instead. See the following "blog":http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  TobbY
                  wrote on last edited by
                  #8

                  thanks all of you, my aim of this question is knowledge and some discussion. i know its not that important topic but it would be helpful for fresh developers.

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TobbY
                    wrote on last edited by
                    #9

                    i have also agreed that qxmlstream* api is faster and occupy less memory. it is helpful in mobile devices where less memory is avilable

                    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