My situation is very specific, and I am a beginner with xmlstarlet.
I have an XML file like the one below, which contains hundreds of entries.
<netbooks>
<file id="2">
<date>2008-06-04 16:40</date>
<author>Daniel</author>
<name bytes="422904" hash="383a39b183">New name of - Just an example.pdf</nome>
<name bytes="383135" hash="5a43dc3524">Just an example.pdf</nome>
</file>
</netbooks>
Where root = netbooks tag.
QUESTIONS
- I have the file hash
5a43dc3524
, i want to take the value of date, that is2008-06-04 16:40
. What's the easiest way to do this? - Also, how to get the attribute
id
(that is2
) from file element? Again, I have the hash, just it.