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. QDomDocument setContent shakes attributes

QDomDocument setContent shakes attributes

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

    I've got some troble reading xml file with a QDomDocument setContent method. It shakes my atrributes in random order. I write xml useing text stream. Then open it by some editors and saw the right order of atrributes. But when I open it using setContent method and save the result, my attributes are in other order than previously.

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      hii Antlcross,

      Setcontent returns true whether an XML data is availabele from the DOM tree. If not, the XML file was not valid.
      Means it is just for checking whether an XML file valid or invalid.

      Hope it will help you.

      Be Cute

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anticross
        wrote on last edited by
        #3

        Thanks, lam Sumit. I found the reason. When I'm reading xml file I use QDomDocument. And actually I use attributes() metod of QDomNode to get attributes of node. But if I use that method my attributes will sort in map in random order. So how can I fix that ? Or are thre other ways to get attributes frome node without sequence error ?

        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