@boogie, are you able to able to provide any more details on what your final XPATH expression was here?
In the XHTML I am trying to parse through (from my old-ish Brother printer), the XPATH expression should ideally be something like:
/html/body/div/div/div[2]/div[2]/div[2]/div/div/div[2]/form/div[2]/dl/dd[3]/div/table/tbody/tr[2]/td/img/@height
.. the specific XHTML fragment of interest looks like:
(in the interests of brevity I have left out much of the rest of the XHTML)
<dt>Toner Level</dt>
<dd>
<div id="ink_level">
<table id="inkLevelMono"
summary="ink level">
<tr>
<th/>
</tr>
<tr>
<td>
<img src="../common/images/black.gif"
alt="Black"
class="tonerremain"
height="50"/>
</td>
</tr>
<tr>
<th>BK</th>
</tr>
</table>
</div>
</dd>
The value that I want is the ‘50’. It is representative of my printer toner quantity remaining.
I have tried expanding out my XPATH string, something like:
"/*[name()='html']/*[name()='body']/*[name()='div']/*[name()='div']/*[name(2)='div']/*[name(2)='div']/ … etc. but that did not seem to work.
The XPATH documentation does not provide any details on how to delve into duplicate tags on the same level of the tree, or how to retrieve properties of tags rather than the text contained within the tags..
Thanks for any insight you can provide!