Parser Xml with Root empty
-
wrote on 3 Dec 2014, 12:31 last edited by
Hello,
I need to do a parser of a xml file with root empty, but I have this error " Failed to load the document "error occurred while parsing element" line 2 column 2". Is there a solution?
@
<?xml version="1.0" standalone="yes"?>
<>
<row>
<scr_code>5</scr_code>
<area_code>0</area_code>
<area_type>0</area_type>
</row>
</>
@
Thanks
Pier -
Hi,
How could that be a valid XML document ?
AFAIK, XML Documents Must Have a root element. Correct me if I'm wrong. "QDomDocument::setContent":http://qt-project.org/doc/qt-5/qdomdocument.html#setContent should give an error. -
wrote on 22 Dec 2014, 16:06 last edited by
Hello,
sorry for the replay but I was outsite.
This file with Java is a valid xml, I don't have a error when I do the parser. How I did a workarround before the parser, I changed <> in <root>
@
<root> <row> <scr_code>5</scr_code> <area_code>0</area_code> <area_type>0</area_type> </row>
</root>
@
I think that is a bug.Thanks
-
Now above is the valid XML. But I dont see a matching closing tag for <roor>. Is that a typo ?
-
wrote on 23 Dec 2014, 07:28 last edited by
Sorry, I correct roor in root
-
wrote on 23 Dec 2014, 13:24 last edited by
http://www.w3schools.com/xml/xml_validator.asp
This shows your original XML is invalid. I don't think it is a bug.