leon22
leon22

Reputation: 5639

Syntax for nesting xml string into xml element

I need something like this:

<xmlData><elementA> (*) </elementA></xmlData>

(*) <xmlData2><elementB>HelloWorld</elementB></xmlData2>

How can I insert the (*) xml string to the placeholder in xmlData (well formed XML)? (parsed with tinyXML in C++)

Thank you very much!

Upvotes: 0

Views: 144

Answers (1)

Christian Stieber
Christian Stieber

Reputation: 12496

Well, you could just use TinyXML to create your XML-DOM :-)

If you just want to use plain old printing, replace the following characters:

  • "<" with "&lt;"
  • "&" with "&amp;"

I also like to replace ">" with "&gt;" for consistency.

Upvotes: 1

Related Questions