PDA

View Full Version : Problem with QDomDocument



justin123
18th March 2011, 01:55
I trying to to QDomDocument to read XML, but it is not reading everything.

Here is the original file:


<!DOCTYPE MapData>
<MapData>
<MapHeader HeaderId="SME" Version="0"/>
<TilesetData TilesetCount="1">
<Tileset0 Width="4032" Height="1248" TileHeight="96" Name="trew4w4" TileWidth="96">
<ImageData I REMOVED THIS PART>
</Tileset0>
</TilesetData>
<LayerData LayerCount="1">
<0 TileCount="1" ZValue="0" Name="Layer 0">
<TileData>
<0 x="0" y="0" SourceId="0" TileId="1"/>
</TileData>
</0>
</LayerData>
</MapData>



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

This is what it had:


<!DOCTYPE MapData>
<MapData>
<MapHeader HeaderId="SME" Version="0"/>
<TilesetData TilesetCount="1">
<Tileset0 Width="4032" Height="1248" TileHeight="96" Name="trew4w4" TileWidth="96"/>
</TilesetData>
</MapData>


What could be causing this?

stampede
18th March 2011, 08:12
What could be causing this?
I think it's caused by your code.

squidge
18th March 2011, 08:40
Your XML is not well-formed, which is probably why QDomDocument is struggling to read it.