Menu

using istream and ostream with tinyXml

Anonymous
2004-04-15
2004-04-19
  • Anonymous

    Anonymous - 2004-04-15

    Could anyone give me an example on how to use to use istream and ostream (<< and >> )to output to xml file and read from xml file with VC++.

    Thank you

     
    • Henrik T.

      Henrik T. - 2004-04-19

      I believe you're supposed to use TiXmlDocument::LoadFile() and TiXmlDocument::OpenFile(). Let TinyXml worry about the streams.

      This works for me in VC++ 6, SP5:

      int main(int argc, char* argv[])
      {
        TiXmlDocument doc("XML testdoc.txt");
        TiXmlElement element("This works");
        doc.InsertEndChild(element);
        doc.SaveFile();
        return 0;
      }

      Note there appears to be a pointer bug (#935500) when using TinyXml with aforementioned compiler & STL support on.

       

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.