I want to find the <issue>
where id = 6
. How do I do it? I tried the following, but it didn't work:
<issues>
<issue>
<id>7</id>
<project id="1" name="testProject"/>
<author id="1" name="testAuthor"/>
<subject>subject</subject>
<start_date>2015-08-24</start_date>
</issue>
<issue>
<id>6</id>
<project id="2" name="testProject2"/>
<author id="2" name="testAuthor2"/>
<subject>subject2</subject>
<start_date>2015-08-24</start_date>
</issue>
</issues>
My XPath expression attempts are:
doc.xpath("//id[contains(text(), '6']")
and
doc.xpath("//issue[@id=6]")