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 5842865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:04:29+00:00 2026-05-22T12:04:29+00:00

I have the following: TiXmlDocument doc; TiXmlDeclaration * decl = new TiXmlDeclaration( 1.0, utf-8,

  • 0

I have the following:

TiXmlDocument doc;
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "utf-8", "");
doc.LinkEndChild( decl );
TiXmlElement * root = new TiXmlElement( "Value" );  
TiXmlElement * element = new TiXmlElement( "number" );  
root->LinkEndChild( element);  

TiXmlText * text = new TiXmlText( "5" );  
element->LinkEndChild( text ); 

IT IS OK LIKE THIS? I WOULD LIKE TO HAVE the .xml like:

<Value>
<number>5</number>
</Value>

THX!

my question is if i can have a int value as a string. if it;s ok if i send in that way the xml file? or is there a way to specify that 5 is an int and not a 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-05-22T12:04:30+00:00Added an answer on May 22, 2026 at 12:04 pm

    If you want to append a node containing an integer value, this integer has first be transformed to a string. You can do this with a variety of functions, but I prefer snprintf (others might differ 🙂 )

    Consider the following example:

    int five = 5;
    char buf[256];
    snprintf(buf, sizeof(buf), "%d", five); // transforms the integer to a string
    TiXmlText * text = new TiXmlText( buf );  
    element->LinkEndChild( text ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have following validation for year value from text input: if (!year.match(new RegExp('\\d{4}'))){ ... }
i have following problem To decode the Biquinary code use the number 5043210. At
Have following String built SQL query: StringBuilder querySelect = new StringBuilder(select * from messages
I have following mysqli configuration settings on a separate file: $mysqli = new mysqli(localhost,
I have following simple code snippet: StringBuilder sb = new StringBuilder(); Locale l =
I have following files and directories in my project root directory main.py bar.py foo
I have following code in C# PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
I have following string: {_id:scheme_version,_rev:4-cad1842a7646b4497066e09c3788e724,scheme_version:1234} and I need to get value of scheme version,
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;

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.