I have a question, let’s say I have an xml string such as the one below:
< request>SayHello< /request>< response>Wave< /response>
If I want the output to be:
Request: SayHello
Response: Wave
How would I proceed? I’m not looking for anything specific I just want to “format” the xml.
Thanks in advance
One way with perl and regexes:
EDIT:
Ok and a bit more generic to catch and print any tags (put in file x.pl):
Usage example would be:
EDIT2:
And then here’s another way with java where you can pull out whatever you want based on an xpath expression: