I have the following XML
<process id="test">
</process>
<process id="test2">
</process>
I do get the correct values from the attributes but I want to have them separated on by a new line for further processing.
When using the command
xmlstarlet sel -t -v "count(process/@id" "example.xml)"
I can see the two are separated because it does return 2
The command used to retrieve the attributes is the following
xmlstarlet sel -t -v "process/@id" "example.xml"
Question :
Can the output be returned with a new line for each attribute? If not could it be done with xmllint?
I was looking at this for 2 days and i found the following page:
http://www.geekfarm.org/wu/muse/XmlStarlet.html
This clarified a lot to me
I have used the following command to achieve the line breaks
xmlstarlet sel -t -m "process" -n -v "@id" "example.xml"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With