I'm trying to modify several TMX files.
TMX files are xml file dedicated to translations interchange.
Inside translations there are tags named as <bpt><ept>. these tags doesn't gets escaped inside the xml.
Example: I have a node, called "seg", that can be like that:
<seg>Hi, I am a text</seg>
or like that:
<seg> <bpt i="1" type="314" x="1" />123<ept i="1" />This is a text </seg>
(or a combination of the two)
Everything that is inside <seg> isn't actually considered as part of the xml structure, but rather textual content, where < and > are not escaped as they should. This is common in this kind of file.
So in case1 issuing a
seg.value = "hello" works, while in case2 i get an xml exception, of course, because there's a structure under it.
Also I would like to issue something like
seg.value ) "<bpt i="1" type="314" x="1" />123<ept i="1" />hello World". and have it updated without < and > encoded.
Considering i may have any combination of any tag inside my text, is there any way to convert a string representation of a xmlnode to a xmlnode object? Or have a
XMLNODE.stringcontent = "xxxxwhatever" function?. Basically what I'd need is a reversed function of xmlnode.tostring.
Thank you very much to anybody who will read and help!