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
11
votes
1 answer

Getting the child elements in tinyxml2

This is probably a novice question, but I am new to tinyxml2 and can't find anything about this. I am trying to loop through a XML file using tinyxml2. image1.png image2.png …
EduAlm
  • 813
  • 3
  • 11
  • 27
6
votes
1 answer

How To query a string attribute with tinyxml2?

Hi does someone know how to to query a attribute in to a string variable, using tinyxml2? Example:
TruckerCat
  • 1,437
  • 2
  • 16
  • 39
5
votes
1 answer

Adding text in tinyxml2

I am trying to create an XML file using TinyXML2. While there are many examples and tutorials on loading, there seems to be very little on saving. I basically want to end up with: text I know I can get the "node" parts by adding an…
Simon Parker
  • 1,656
  • 15
  • 37
5
votes
3 answers

How to convert an XMLElement to string in TinyXML2

In TinyXml 1 it was possible to convert a child element to a string using the << operator, e.g. TiXmlElement * pxmlChild = pxmlParent->FirstChildElement( "child" ); std::stringstream ss; ss << (*pxmlChild); This doesn't appear possible in TinyXml2.…
snowdude
  • 3,854
  • 1
  • 18
  • 27
4
votes
3 answers

TinyXML2/C++ - Insert an element

I wanted to serialize objects with XML, so I got TinyXML. However I went with the newer TinyXML2. Problem is, I can't find a tutorial anywhere, so I just read the documentation. However, I seem to be stuck with adding an element to the…
rcplusplus
  • 2,767
  • 5
  • 29
  • 43
4
votes
1 answer

Read an xml file using tinyxml2 in C++

I don't know how to read this xml file using tinyxml2 in C++ UnaCantidad 1 UnNombre1
fbr
  • 98
  • 1
  • 1
  • 9
4
votes
1 answer

How can I parse an empty element with tinyxml2?

Using tinyXml2, I can parse 2010-07-01 14:28:20 just fine, but and both throw exceptions in C++ when those are perfectly valid XML (to my knowledge). Does anyone have a fix or suggestion for…
Mishka
  • 349
  • 1
  • 5
  • 10
3
votes
1 answer

tinyxml2 building and writing xml file on c++

I am trying to build a simple xml file using tinyxml2 in VS2019, for some reason the code works until it hits the element named port. this element and every element after it is ignored in the xml file. I just noticed, it is also writing xml output…
2
votes
0 answers

XML Parser not showing informations C++

I am using TinyXML2 and I got some strange problem. So It seems it work because I dont have any crashes but when I want to output one of the value I got I have nothing , if someone know why ? I already used tinyxml2 and it was working but here maybe…
aetopiu
  • 41
  • 2
2
votes
0 answers

C++ Builder 10.4 and Tinyxml

Good evening, I try to use tinyxml 2 with my C++ builder IDE. The code is really simple. I only want to parse an existing XML-File. The Code looks like this: #include "tinyxml2.h" using namespace tinyxml2; class myclass { XMLDocument doc_; } And…
Hoeh
  • 45
  • 4
2
votes
1 answer

tinyxml cannot parse const char* correctly

I use tinyxml2 to deal with a string that contains xml. I use the function Parse but it just read a part of the string and return XML_SUCCESS #include "XML/include/tinyxml2.h" #include #include int main(int argc, char*…
longack
  • 105
  • 7
2
votes
1 answer

tinyxml2: Difference between doc.Print() and doc.SaveFile()

I just asked myself if there are any differences between saving a file via doc.Print() and doc.SaveFile() in tinyxml2. Here is a quick example: Let's say we have a filepointer and a XML document from where we get our data. FILE…
2
votes
2 answers

tinyxml2 XMLElement constructor private?

In TinyXml you could create an Element e.g. TiXmlElement("tag"), but in TinyXml2 there is no public constructor for XMLElement? How do you create elements ?
rmhartman
  • 89
  • 5
2
votes
1 answer

Updating data on a XML DOM c++ using tinyxml-2

I was wondering how could I update the data on the DOM for a certain attribute? I've searched but I couldn't find anything. Basically, I have an attribute called Hour(for example it's "11:03") and I want the text from that specific attribute to be…
Gimv30
  • 55
  • 7
2
votes
3 answers

Get integers and floats from xml

I'm using tinyxml2 and I know how to get strings of attributes, but I want to also get integers, floats and booleans too. So, I have this code: #include #include #include using namespace std; using namespace…
Poriferous
  • 1,566
  • 4
  • 20
  • 33
1
2 3 4 5 6 7 8