How to get XML of a node? There is a method Print, which gives me formatted xml, but I need to pass FILE pointer to Print. I want to get the xml in string and don't want file operations. Is there any way to achive this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used TiXmlPrinter object and it worked fine with node. But if I want to get xml of Attribute, I cannot use TiXmlPrinter object as Accept method is not there in TiXmlAttribute class. Please let me know if there is any solution for this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure to understand what do you mean by "get xml of attribute", but if I guess correctly you may just derive your own Printer class from TiXMLPrinter redefining the VisitEnter(const TiXmlElement&, const TiXmlAttribute*) method (and perhaps the VisitExit one as well).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How to get XML of a node? There is a method Print, which gives me formatted xml, but I need to pass FILE pointer to Print. I want to get the xml in string and don't want file operations. Is there any way to achive this?
Use the << operator or a TiXmlPrinter object.
Thanks for reply!
I used TiXmlPrinter object and it worked fine with node. But if I want to get xml of Attribute, I cannot use TiXmlPrinter object as Accept method is not there in TiXmlAttribute class. Please let me know if there is any solution for this?
I am not sure to understand what do you mean by "get xml of attribute", but if I guess correctly you may just derive your own Printer class from TiXMLPrinter redefining the VisitEnter(const TiXmlElement&, const TiXmlAttribute*) method (and perhaps the VisitExit one as well).