0

I am using xmlint to parse a xml document.

sample document is this

<?xml version="1.0"?>
<top>
<c>
    <a n="zzz"><i>0</i></a>
</c>
<c>
    <a n="zzz"><i>1</i></a>
</c>
</top>

I am doing something like this

xmllint -xpath '//top/c/a[@n="zzz"]/i/text()' a.xml

and I get

<i>0</i><i>165</i>

If I do

xmllint -xpath '/ad/c/a[@n="sid"]/i/text()' f.xml

I get 01

My desired output is (there is a carriage return)

0

1

NinjaGaiden
  • 3,046
  • 6
  • 28
  • 49
  • It would be helpful if you could update your question by including a minimal sample XML document. See this guide for more info - http://stackoverflow.com/help/mcve. – Taylor D. Edmiston Sep 28 '16 at 15:56
  • Possible duplicate of [select an xml element, ignore element name, print newline](http://stackoverflow.com/questions/21053097/select-an-xml-element-ignore-element-name-print-newline) – Matthias Wiehl Sep 28 '16 at 20:15

0 Answers0