Questions tagged [tinyxml2]

TinyXML-2 is a simple, small, efficient, C++ XML parser

TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs.

106 questions
0
votes
2 answers

parsing comment in tinyXML2

I have problem with parsing XML comment. How can i properly access to comment? Or is even possible to read comment with tinyXML2? Text I created XMLElement *root =…
gomess
  • 83
  • 1
  • 8
0
votes
1 answer

TinyXML2/C++ - create empty element

I'm trying to create XML file with TinyXML2. string _text = "text"; XMLElement *body = xmlDoc->NewElement("body"); body->SetText(_text.c_str()); Give me: …
gomess
  • 83
  • 1
  • 8
0
votes
1 answer

Why I get unresolved external errors when I want to link the release version of the static library TinyXML 2 in C++ Builder Starter?

I got a simple question. I read that linking debug static libraries to release executables is considered a bad thing. So I compiled the static library of TinyXML 2 in release mode. Library compiled without any errors. But when I want to link the…
0
votes
2 answers

TinyXML2: Replace Node function?

I am having a hard time using TinyXML2 (https://github.com/leethomason/tinyxml2) to write a C/C++ method that replaces a given node like: Foo ...with another node: …
0
votes
1 answer

TinyXml2 XMLDocument parse after create new Element crash

In TinyXmlv1 i can create a temp Xml Element then Parse document by TiXmlDocument doc; TiXmlElement * element = new TiXmlElement( "Hello" ); TiXmlText * text = new TiXmlText( "World" ); element->LinkEndChild( text ); doc.Parse(""); //…
xfr1end
  • 303
  • 5
  • 8
0
votes
2 answers

TinyXML cant load my file

ive been working one some stuff for university were to save some stuff and i chose tinyxml to do so TiXmlDocument doc; TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "", ""); doc.LinkEndChild(decl); TiXmlElement* cm = new…
Jonny0815
  • 21
  • 2
0
votes
1 answer

What is the alternative to `TiXmlNode::FirstChild(const char *)` in TinyXML-2?

I am updating code that uses the legacy TinyXml library, to use new TinyXML-2 version instead. While editing, I noticed that the function TiXmlNode::FirstChild(const char *) has no direct replacement in TinyXML-2. My questions are: Is there a…
user7023624
  • 571
  • 5
  • 14
0
votes
1 answer

TinyXml2 stream printing

How can I set a XMLDocument for stream printing in TinyXML-2? Im trying to port code from TinyXML-1 to TinyXML-2. In TinyXML-1, I could do something like: TinyXmlPrinter…
0
votes
1 answer

TinyXML2 SetAttribute Can't Accept String Object?

I'm using TinyXML2 and I'm facing an issue with SetAttribute. It accepts a string literal (i.e. "001") but not a string variable. void createDoc(string customerID, string name) { XMLDocument doc; XMLNode * pRoot =…
Amos Tan
  • 1
  • 2
0
votes
1 answer

Segmentations fault on tinyxml2 when XML file is missed

I am trying to take some information from Cophir XML data. However, some XML files are poor, which is causing a segmentation fault. The code I am trying to execute, and that is causing the error is: PhotoComments comments; XMLElement*…
Alucard
  • 16,628
  • 7
  • 24
  • 23
0
votes
4 answers

How To Iterate XML Nodes in C++ with the TinyXML2 Library

How does one iterate nodes in TinyXML2? I tried following the documentation but am not able to grasp this. http://www.grinninglizard.com/tinyxml2docs/index.html My XML is already loaded into std::string. Thus, the following compiles: #include…
Volomike
  • 23,743
  • 21
  • 113
  • 209
0
votes
1 answer

Why can't I copy the contents of an XMLDocument to another XMLDocument using TinyXml2?

I do not understand why the below code doesn't work as intended to copy the one element from doc1 to doc2: void test_xml(){ using namespace tinyxml2; XMLDocument doc1, doc2; XMLPrinter…
Will Kydd
  • 3
  • 4
0
votes
1 answer

TinyXML2 parser c++ strange tag

Good morning everyone, I have to parse an XML file and I decided to use tinyxml2. I did something and then I stopped because I don't know how can I parse this.
ScazzoMatto
  • 99
  • 1
  • 4
  • 12
0
votes
1 answer

TinyXML2 advance to next sibling

I'm not sure how to format the XML file, so here is a direct link if it is unreadable in the stackoverflow code format. XML Description: test = root name = child of test numofIndx -> dwellms = subchildren of name index = child of test - -…
0
votes
3 answers

How to get xml file parsed using TinyXml2 in c++ program?

I am using TinyXml2 for the first time to get a xml file as follows: 132487A-J crank casing Alive 1 So, how will i get this type of xml…
anamika email
  • 327
  • 9
  • 21