I am working on XML file like
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>adc</author>
<year>2005</year>
<price>30.00</price> </book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>xyz</author>
<year>2005</year>
<price>29.99</price> </book>
</bookstore>
Using xmlstarlet on linux
xmlstarlet sel -t -m 'bookstore/author [1]' -n books.xml
Would give output as "adc"
, but how can I find the field when I already know the value?
Like I know author tag has value "adc"
.
How should I find bookstore/author [x]
the x
?