0

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!

leon22
  • 5,280
  • 19
  • 62
  • 100
  • Would you be use namespaces with one or both of the sets of XML? Then the inner XML can remain XML rather than having to be escaped. – Jon Hanna Aug 24 '12 at 15:36

1 Answers1

1

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.

Christian Stieber
  • 9,954
  • 24
  • 23