Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:23:59+00:00 2026-06-13T22:23:59+00:00

I am trying to create an XML file using TinyXML2. While there are many

  • 0

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:

<node>text</node>

I know I can get the “node” parts by adding an element, but how do I set the text part? Element has a GetText but I can find no SetText. There is also an XMLText class, but that has no methods for setting the text!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:24:00+00:00Added an answer on June 13, 2026 at 10:24 pm

    I built with G++ 4.2.1 on OS X 10.6, and it runs fine. Output is <Version>1.0.0</Version>.

    #include "tinyxml2.h"
    
    using namespace tinyxml2;
    
    int main(int argc, char* argv[])
    {
       tinyxml2::XMLDocument doc;
       tinyxml2::XMLElement* versionNode = doc.NewElement("Version");
       tinyxml2::XMLText* versionText = doc.NewText("1.0.0");
    
       versionNode->InsertEndChild(versionText);
       doc.InsertEndChild(versionNode);
    
       XMLPrinter printer;
       doc.Print();
    
       return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to dynamically create an XML file using php like this: header
I am trying to create a dynamic menu by reading an XML file using
I am trying to create java objects from xml file. I am using jaxb(unmarshalling)
Trying to create a PDF file based on an XML and a file using
I am trying to extract values from an XML file using linq to create
I am trying to create controls at runtime by using an XML file. How
I'm trying to create an XML file using C# and Linq to XML, but
I am trying to create a new XML file from an exisiting one using
im trying to create an xml data into JSP using a resource file: MyData.properties
im trying to create a xml file using php.everytime i run the code the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.