Editing contents in XML file.
in
Programming Questions
•
1 year ago
Hi!
I have searched for this for quite a while now, but I have not really reached any answers about how to do this. I am working with an XML-file that is tagged in indesign. It is basically just alot of text with a few words here and there that are tagged. The basic structure is like this:
<?xml version="1.0"?>
<root>
<text>Hello, My name is <name>Mariel</name> and I am an excellent dancer. Just as good as the more famous <name >Mariel</name> who stole my name.</text>
</root>
what I want to do is exchange the words within the <name> tags with something else. The text I am working on is quite large and there are maybe fifty different tags that needs to be recognized and changed (many tags like <name> show up in different parts of the text). So i need some kind of system for it.
I have managed to load the xml file and put the contents of the tags in an String-array and change it like how i want to have it. But I dont know who to write it back to an xml file? What would you guys do if you were facing the same problem?
Thanks in advance,
Regards
Lukas Arvidsson
1