Please help me to put element and text nodes into an array of Strings.
For example an .xml file has:
<soap:Envelope>
<soap:Body>
<ser:getTitle>
<!--Optional:-->
<ser:title>Meeting</ser:title>
</ser:getTitle>
<ser:getDiscription>
<!--Optional:-->
<ser:discription>this is the meeting</ser:discription>
</ser:getDiscription>
...
</soap:Body>
</soap:Envelop>
Now I want to place the values into the String[] key, value as follows:
key[0] = "title";
value[0] = "meeting";
key[1] = "discription";
value[1] = "this is the meeting";
… and so on.
Many thanks in advance!
You can use DOM to parse your input XML and use something like:
Alternatively you could use XPATH with the
expression, as described here: Question 7199897