Hi guys, I'm wondering which encoding is used to save the document I read. So I'd like to get TiXmlDeclaration->Encoding(); But how can I get TiXmlDeclaration from
TiXmlDocument doc; doc.Parse((const char *)stringWithDocument);
?
Thanks in advance
If (emphasis if) your XML has the declaration, it would be the first node in the tree. So:
TiXmlDeclaration* dec = doc.FirstChildElement()->ToDeclaration();
lee
Log in to post a comment.
Hi guys,
I'm wondering which encoding is used to save the document I read. So I'd like to get TiXmlDeclaration->Encoding(); But how can I get TiXmlDeclaration from
TiXmlDocument doc;
doc.Parse((const char *)stringWithDocument);
?
Thanks in advance
If (emphasis if) your XML has the declaration, it would be the first node in the tree. So:
TiXmlDeclaration* dec = doc.FirstChildElement()->ToDeclaration();
lee