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. StartDocument() method: Usage
Forum Updated to NodeBB v4.3 + New Features

StartDocument() method: Usage

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 935 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.
  • P Offline
    P Offline
    Paawan
    wrote on last edited by
    #1

    Hi All,

    I am not able to grasp what exactly does the startDocument() method does when parsing an XML document.

    In my text book the following is given;

    @
    bool myHandler::startDocument(){

    indent =" " // indent is a QString object

    return true;

    @

    I cannot understand why this is required as there is no testing that is done.

    Thanks

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Paawan
      wrote on last edited by
      #2

      Just to add to the above.

      The methods that were used in the derived MyHandler class (derived/sub-classed from QXmlDefaultHandler class) are

      bool startDocument()
      bool startElement(....)
      bool characters(....)
      bool endElement(....)

      I am assuming the return types are bool because if there is a problem with the XML document it will through an error and stops. Else it continues?

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

        Hi,

        For more information, you can read the documentation of "QXmlContentHandler":http://qt-project.org/doc/qt-5/qxmlcontenthandler.html

        Hope it helps

        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
        0

        • Login

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