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

Extracting sub-tree XML string with TinyXml2

I want to do the exact same thing as the guy in this question. I want to convert an XML child element (and all of its children) to an XML string, so if the XML structure were abc I…
Jim Clay
  • 963
  • 9
  • 24
2
votes
1 answer

tinyxml2 Equivalent of TiXmlNode Enumeration?

What is the tinyxml2 (v2) replacement for v1's TiXmlNode enumeration? TinyXML v1 can switch on node type, but how to do the same with TinyXML v2's XMLNode. switch (node->Type()) // v1 node type selector { case TiXmlNode::DOCUMENT: wcout…
BSalita
  • 8,420
  • 10
  • 51
  • 68
2
votes
1 answer

tinyxml2::XMLDocument redefinition with msxml

I'm using cocos2d-x library. cocos2d-x has tinyxml2 lib. But tinyxml2::XMLDocument is in conflict with ms's XMLDocument in msxml. I use tinyxml2::XMLDocument as this code: tinyxml2::XMLDocument Doc; but in virtual studio 2010, i get the error c2371…
1
vote
0 answers

Saving a string in xml file with TinyXML2

I'm pretty much starting out with C++ and in making a simple console program ran into a problem I couldn't solve. I looked everywhere for the solution and didn't find it so I'll try asking. I want to save data from a string to xml file with…
1
vote
0 answers

TinyXML2 Document Save Double Precision Issues

I'm using TinyXML2 to generate XML spreadsheets, and I have a simple regression test comparing a newly generated sheet to a previously verified sheet to ensure new changes don't break the tool. This test has been working for a while, but recently it…
Raika Dial
  • 13
  • 3
1
vote
1 answer

Removing selected child elements in a XML file C++

I'm using tinyxml2. I have xml file with many elements on one node. My xml file: 14
janullo789
  • 41
  • 5
1
vote
1 answer

TinyXML2 failed at start

I am using TinyXML2 to parse XML and when I try to run I get the following error: FAILED: project_flag : && /Library/Developer/CommandLineTools/usr/bin/c++ -std=c++11 -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk…
Fasmog
  • 11
  • 1
1
vote
0 answers

How to select nodes from a xml tree that contains a specific children using tinyxml2

From the tree below : All the elements in b which have the child element c. In-short how to query the xml tree for the xpath "/b[c]" using tinyxml2.
alooparantha
  • 51
  • 1
  • 5
1
vote
0 answers

Ignore commented out tags when read xml file using tinyxml library in c++

When i read xml file using c++, the commented out tags read also and i want to ignore it i.e: ------- ------- -------
1
vote
1 answer

Problem: Visual C MFC Dialog editor “Failed to return new Code Element. Possibly syntax error. New Element Name test”

I have a simple MFC application, using Visual Studio 2019. My problem is that when I want to add a variable to any control I get the pop up message: Failed to return new Code Element. Possibly syntax error. New Element Name test To clarify: The…
enocknitti
  • 31
  • 8
1
vote
2 answers

Reading a XML file in C++ with TinyXML2

I'm pretty new to using XML in C++ and i'm trying to parse a list of files to download. THe XML file I'm using is generated via PHP and looks like this :
Ryn
  • 25
  • 7
1
vote
0 answers

Ensuring a file is saved to XML before opening it with CHtmlView control

I use this code to save the data to XML: bool CMeetingScheduleAssistantApp::SaveToXML(CString strFileXML, tinyxml2::XMLDocument& rDocXML) { FILE *fStream = nullptr; CString strError, strErrorCode; errno_t eResult; bool …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1
vote
1 answer

Reading in all sibling's elements with TinyXML

I have a problem with reading an XML file! The code below is for getting a children's values(country) out from the XML file, however I would need to go through all the siblings( all three countries) and I would need a solution, which works with also…
1
vote
1 answer

passing pointer from one function to other returns a address but accessing it causes segmentation fault

below is the code for load file .On button click event the load function is called which return XMLElement pointer variable.(a valid address is returned) but unable to access the members of XMlElement using ->operator because segmentation fault…
1
vote
1 answer

How to make a node inside a node using tinyxml2?

XMLDocument xmlDoc; XMLNode * pRoot = xmlDoc.NewElement("Head"); xmlDoc.InsertFirstChild(pRoot); XMLElement * pElement = xmlDoc.NewElement("Stat1"); pElement-> SetText(10); pRoot->InsertEndChild(pElement); pElement =…
Lim Ta Sheng
  • 371
  • 3
  • 8