From the below xml how to find a node exists with value docx and attribute indexed = 1?
I don’t want to use loop and this need to be done in JavaScript
<docs>
<doc>
<name indexed='1'>doc</name>
</doc>
<doc>
<name indexed='1'>xls</name>
</doc>
<doc>
<name indexed='0'>xlsx</name>
</doc>
<doc>
<name indexed='1'>docx</name>
</doc>
..
..
</docs>
Assuming your platform is a web browser you can use jQuery:
Or if you do not want to use jQuery and only the built in
DOMParser: