Menu

TiXmlOutStream

Developer
2006-11-03
2013-05-20
  • Gabor Sikabonyi

    Gabor Sikabonyi - 2006-11-03

    Hello,

    I can not compile this code whit the new (2.5.2) version of tinyxml:

    TiXmlDocument doc;
    ...
    TiXmlOutStream s;

    s<<doc;
     
    ...
    It has compiled whit an older version. (2.3.2, maybe)
    Have someone a good idea?

    Thanks!

    Gabor

     
    • Nicola Civran

      Nicola Civran - 2006-11-03

      Use a TiXmlPrinter instead:

      TiXmlPrinter p;
      p.SetStreamPrinting();
      doc.Accept(&p);

      HTH
      Nicola

       
    • Gabor Sikabonyi

      Gabor Sikabonyi - 2006-11-04

      Hello,

      Firstly, thank you for your help! :-)
      I am using this outstream to write the
      complet document to a string.
      Can I use TiXmlPrinter to do it?
      Thank you very much!

      Regards,
      Gabor

       
      • Nicola Civran

        Nicola Civran - 2006-11-06

        Of course, you can. Use the CStr() method (or Str() if you are using STL).
        Read at end of tinyxml.h for more details on TiXmlPrinter class.
        Bye.

        Nicola

         
    • Gabor Sikabonyi

      Gabor Sikabonyi - 2006-11-07

      Hi,

      It is good... but not enough. :-) I have to send this information to a client who try to parse it. The conversion from doc to string is working but the string will be a readable string not a "parseable". (There is a < not an &lt; string...) How can I solve tis problem?

      Thanks!
      Gabor

       
      • Nicola Civran

        Nicola Civran - 2006-11-07

        I'm sorry, but I don't understand your question: where, exactly, do you get "<" but you're expecting "&lt;"?

         
    • Gabor Sikabonyi

      Gabor Sikabonyi - 2006-11-07

      Hello,

      I have a server application which builds an xml from Windows registry. I have to convert this xml to a string and send it to a client. If I have "<" instead of "&lt;" in data tags of "xml string", the client couldn't pharse. When I have used the TiXmlOutStream, I haven't got a problem whit this conversion...
      Thank you for your help!

      Regards,
      Gabor

       
      • Nicola Civran

        Nicola Civran - 2006-11-07

        The code I suggested to you is simply the actual implementation of operator<<(), which was formerly implemented by the no-more-existing StreamOut() function.
        I've made the same changes in my code and my library works as it worked previously.
        I see no reason that may leads the new implementation to work differently from the old one, except perhaps a bug fix.
        Anyway, without an (explicit) example, I'm not be able to help you more than this.

        Best regards,
        Nicola

         

Log in to post a comment.