Results 1 to 3 of 3

Thread: Problem with QDomDocument

  1. #1
    Join Date
    Jun 2010
    Posts
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with QDomDocument

    I trying to to QDomDocument to read XML, but it is not reading everything.

    Here is the original file:
    Qt Code:
    1. <!DOCTYPE MapData>
    2. <MapData>
    3. <MapHeader HeaderId="SME" Version="0"/>
    4. <TilesetData TilesetCount="1">
    5. <Tileset0 Width="4032" Height="1248" TileHeight="96" Name="trew4w4" TileWidth="96">
    6. <ImageData I REMOVED THIS PART>
    7. </Tileset0>
    8. </TilesetData>
    9. <LayerData LayerCount="1">
    10. <0 TileCount="1" ZValue="0" Name="Layer 0">
    11. <TileData>
    12. <0 x="0" y="0" SourceId="0" TileId="1"/>
    13. </TileData>
    14. </0>
    15. </LayerData>
    16. </MapData>
    To copy to clipboard, switch view to plain text mode 

    I suspected that it wasn't reading everything, so I dumped what it read to another file using QTextStream.

    This is what it had:
    Qt Code:
    1. <!DOCTYPE MapData>
    2. <MapData>
    3. <MapHeader HeaderId="SME" Version="0"/>
    4. <TilesetData TilesetCount="1">
    5. <Tileset0 Width="4032" Height="1248" TileHeight="96" Name="trew4w4" TileWidth="96"/>
    6. </TilesetData>
    7. </MapData>
    To copy to clipboard, switch view to plain text mode 

    What could be causing this?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Problem with QDomDocument

    What could be causing this?
    I think it's caused by your code.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QDomDocument

    Your XML is not well-formed, which is probably why QDomDocument is struggling to read it.

Similar Threads

  1. QDomDocument & XML
    By ManuMies in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2009, 07:46
  2. Need help for QDomDocument
    By vajindarladdad in forum Newbie
    Replies: 6
    Last Post: 22nd April 2009, 12:18
  3. Split QDomDocument to new QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 4
    Last Post: 28th January 2009, 09:59
  4. QDomDocument inside other QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 15:27
  5. QDomDocument problem !!!
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2006, 22:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.