Menu

How to get TiXmlDeclaration

dezoo
2007-07-14
2013-05-20
  • dezoo

    dezoo - 2007-07-14

    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

     
    • Lee Thomason

      Lee Thomason - 2007-07-20

      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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.