I'm facing an issue while parsing the xml given below.
In the above example, the Element1 node has text content 'Test1' followed by a child node Element2 and then text 'Test2'.
I'm using SAX parser to parse the xml and obtain a node(HashNode) representation of the xml to regenerate the message later.
The problem I'm facing is while setting the value for the Element1.
the Element1 node takes only one value, so the value is getting replaced.
I don't want to use DOM parser as it's a small xml file and there might be performance issues.
Also, I want to make sure that the order of the nodes is not affected. i.e Test1 followed by Element2 and then Test2.
Can anyone please guide me?
Try to use XPath component :)
Check this tutorial in roseindia
you can use dom xml parser there is no question of any performance issues it is best for small as well as for large xml files.