Hi!
I'm having trouble reading the follwing Xml file:

Qt Code:
  1. <ArrayOfScore xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Score><GameKey>201610629</GameKey><SeasonType>1</SeasonType><Season>2016</Season><Week>6</Week><Date>2016-10-13T20:25:00</Date><AwayTeam>DEN</AwayTeam><HomeTeam>SD</HomeTeam><AwayScore>13</AwayScore><HomeScore>21</HomeScore><Channel i:nil="true"/><PointSpread>3.0</PointSpread><OverUnder>44.5</OverUnder><Quarter>F</Quarter><TimeRemaining i:nil="true"/><Possession i:nil="true"/><Down i:nil="true"/><Distance i:nil="true"/><YardLine i:nil="true"/><YardLineTerritory i:nil="true"/><RedZone i:nil="true"/><AwayScoreQuarter1>0</AwayScoreQuarter1><AwayScoreQuarter2>3</AwayScoreQuarter2><AwayScoreQuarter3>0</AwayScoreQuarter3><AwayScoreQuarter4>10</AwayScoreQuarter4><AwayScoreOvertime>0</AwayScoreOvertime><HomeScoreQuarter1>7</HomeScoreQuarter1><HomeScoreQuarter2>3</HomeScoreQuarter2><HomeScoreQuarter3>9</HomeScoreQuarter3><HomeScoreQuarter4>2</HomeScoreQuarter4><HomeScoreOvertime>0</HomeScoreOvertime><HasStarted>true</HasStarted><IsInProgress>false</IsInProgress><IsOver>true</IsOver><Has1stQuarterStarted>true</Has1stQuarterStarted><Has2ndQuarterStarted>true</Has2ndQuarterStarted><Has3rdQuarterStarted>true</Has3rdQuarterStarted><Has4thQuarterStarted>true</Has4thQuarterStarted><IsOvertime>false</IsOvertime><DownAndDistance i:nil="true"/><QuarterDescription>Final</QuarterDescription><StadiumID>14</StadiumID><LastUpdated>2016-10-17T14:27:48</LastUpdated><GeoLat>32.783188</GeoLat><GeoLong>-117.119439</GeoLong><ForecastTempLow>58</ForecastTempLow><ForecastTempHigh>76</ForecastTempHigh><ForecastDescription>Sunny</ForecastDescription><ForecastWindChill>70</ForecastWindChill><ForecastWindSpeed>14</ForecastWindSpeed><AwayTeamMoneyLine>-160</AwayTeamMoneyLine><HomeTeamMoneyLine>140</HomeTeamMoneyLine><Canceled>false</Canceled><Closed>true</Closed><LastPlay i:nil="true"/><StadiumDetails><StadiumID>14</StadiumID><Name>Qualcomm Stadium</Name><City>San Diego</City><State>CA</State><Country>USA</Country><Capacity>70561</Capacity><PlayingSurface>Grass</PlayingSurface><GeoLat>32.783188</GeoLat><GeoLong>-117.119439</GeoLong></StadiumDetails></Score></ArrayOfScore>
To copy to clipboard, switch view to plain text mode 

I use the following code to try to read the elements:

Qt Code:
  1. QFile testxml("./test.xml");
  2. if(testxml.open(QIODevice::ReadOnly)) {
  3. QXmlStreamReader XMLData(&testxml);
  4. while(!XMLData.atEnd() && !XMLData.hasError()) {
  5. XMLData.readNext();
  6. qDebug() << XMLData.readElementText();
  7. if(XMLData.isStartElement()) {
  8. qDebug() << XMLData.name();
  9. qDebug() << XMLData.readElementText();
  10. }
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

But I only get two empty strings.

I have tried reading another Xml file which looks very similar and which is also everything in one line and I can successfully parse the elements. With this file it is somehow not working.

Does anyone have any idea what could I be doing wrong?