tinyxml

TinyXML: Save document to char * or string

I'm attempting to use TinyXML to read and save from memory, instead of only reading and saving files to disk. It seems that the documnent's parse function can load a char *. But then I need to save the document to a char * when I'm done with it. Does anyone know about this? Edit: The printing & streaming functions aren't what I'm looki...

How does the UTF-8 support of TinyXML work

I'm using TinyXML (http://www.grinninglizard.com/tinyxml/) to parse/build XML files. Now according to the documentation (http://www.grinninglizard.com/tinyxmldocs/) this library supports multibyte character sets through UTF-8. So far so good I think. But, the only API that the library provides (for getting/setting element names, attribut...

Odd behavior from TinyXML++

Hoping some of you TinyXML++ people can help me out. Really, since you recomended to me before I think you owe me ;) I have the following code: //ticpp::Iterator< ticpp::Element > child( "SetPiece" ); ticpp::Iterator< ticpp::Node > child("SetPiece"); GLuint lc_SPieces = 0; for(child = child.begin( this ); child != child....

getter setter wrappers for TiXmlElement*'s

Hi i am rewriting a project so that it uses getters and setters to reference the TiXmlElement *'s However i quickly run into problems that seem to be related to debug mode: ecxerpt from my class's header: TiXmlElement *_rootElement; TiXmlElement *_dialogsElement; TiXmlElement *_dialogElement; TiXmlDocument _document; void setDocu...

TinyXML: how to parse a file pointer

I'm trying to connect the output of popen, a file pointer, to the input of TinyXML. According to the main page, the best way to do it is using the parse method: C style input: * based on FILE* * the Parse() and LoadFile() methods I believe I need to use the TIXML_USE_STL to get to this. How do I go about finding examples and...

How to create separate library for include in C++/Eclipse

I've gotten some C++ code to work with the TinyXML parser. However, to do this I had to include the source code from TinyXML with my regular source code. I'd like to have TinyXML included as a separate library. I'm using Eclipse with the Cygwin C++ compiler. What's a good way to do this? ...

How to use TinyXml to parse for a specific element

I would like to parse a group of elements out of a TinyXml output. Essentially, I need to pick out any port element's "portid" attribute of the port has a state of "open" (shown below for port 23). What's the best way to do this? Here's the (simplified) listing for the output from TinyXml: <?xml version="1.0" ?> <?xml ?> <nmaprun> ...

What memory management do I need to cleanup when using TinyXml for C++?

I'm doing the following with TinyXml: TiXmlDocument doc; TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); TiXmlElement* main = new TiXmlElement("main"); TiXmlElement* header = new TiXmlElement("header"); header->SetAttribute("attribute","somevalue"); main->LinkEndChild(header); // ... Add many more TiXmlElment* to other...

XML Serialization/Deserialization in C++

I am using C++ from Mingw, which is the windows version of GNC C++. What I want to do is: serialize C++ object into an XML file and deserialize object from XML file on the fly. I check TinyXML. It's pretty useful, and (please correct me if I misunderstand it) it basically add all the nodes during processing, and finally put them into a...

How to best save XML files

I have a bunch of classes that each read in their values from an XML file using TinyXML. I've done this so everything is in memory, and my user is using the app and making changes. If the user presses Save, I need to iterate through my objects and call the Save() function which writes out the XML file. Should I rebuild the XML file pr...

Is there a limit to how big an xml file can be for tinyxml to parse it?

I have an xml file that is about 42k in size. Shouldn't tinyxml be able to parse a file of this size. Looking at the tinyxml source code, it appears to just read the entire file in as a char *. When I reduce the xml file in size to 7k, tinyxml works just fine. Is there a definitive limit to the # of bytes that tinyxml will parse? ...

TinyXML can't read its own file

Hello there! I'm currently working on a C++ MFC project on visual studio 2003. The aim of this project is to be able to take an XML file containing language data, convert it to a simple CSV file and back to XML. To do this, I'm using the TinyXML library, which is simple and good enough for my needs. The problem is that, once I try to c...

load XML from variable, not File

Hello, I'm trying to parse XML data stored in a variable, not a file. The reason for this is that program x replies to program y in XML, so it would seem to be best to directly parse the XML from the variable. So far I have tried to do this in TinyXML, but I don't see an interface to load from a variable. It's basically the opposite ...

Tinyxml to print attributes

I'm trying to get std::string from attribute's value with TinyXml. The only thing I can get is a const char * val, and I can't find any way to convert from const char * to a std::string. so two possible answers to that: 1. How to get a string of an attribute with TinyXml? 2. How to convert const char * val to string val. this is the co...

Visual Studio 2005 and Tinyxml - xml file location

For some reason my Tinyxml file which is created via visual studio 2005 (c++) is saved on my desktop instead of the debug folder or in the program's root folder. if anyone knows about some way to tell vs2005 to save the tinyxml create file somewhere else? I tried that with eclipse and it saved the file in the program's root folder, whi...

Tinyxml Multi Task

I have a single xml file and every new thread of the program (BHO) is using the same Tinyxml file. every time a new window is open in the program, it runs this code: const char * xmlFileName = "C:\\browsarityXml.xml"; TiXmlDocument doc(xmlFileName); doc.LoadFile(); //some new lines in the xml.. and than save: doc.SaveFile(xmlFileName);...

how to get CDATA in xml file using tinyxml library. If possible give a 2-3 line code snippet?

how to get CDATA in xml file using tinyxml library. If possible give a 2-3 line code snippet? ...

TinyXML Iterating over a Subtree

Does anyone have code to iterate through the nodes of a subtree in TinyXML? IE: Given a parent, iterate through all its children and all of its children's children? ...

Using TinyXML ( linking libraries ? in c++ )

+Hi... i am a newbie ... and i don't know how to include external libraries in c++. This is sooo hard. I want to use TinyXML. so i made this : example2.cpp #include <iostream> #include "tinyxml.h" void write_app_settings_doc( ) { TiXmlDocument doc; TiXmlElement* msg; TiXmlDeclaration* decl = new TiXmlDeclaration( "...

Can TinyXml load Xml from string instead of file?

Hi everyone, I'm using TinyXml library for my application but TiXmlDocument object just only can load Xml file. How can it load Xml from string. Could you tell me the way to do this. Thank you very much Tu. ...