|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how to xpath the *value* of an attribute based on valu
Hi, sorry if this has been answered a hundred times but I haven't had
much luck finding this in the archives.
For this xml:
<xtf:snippets>
<xtf:snippet score="100" rank="1" hitNum="5">
MS Clark Library, University of
<xtf:hit>
<xtf:term>California</xtf:term>
</xtf:hit>. 40 Albion Street Broadstairs |
</xtf:snippet>
</xtf:snippets>
... I want to write an xpath that will select just the numeric value
of 5 for the attribute hitNum, based on its being a sibling attribute
of rank="1". However, I can't get any closer than selecting the whole
xtf:snippet element. This are a couple ways of accessing that
inadequate result:
/xtf:snippets/xtf:snippet[@rank='1']/attribute::hitNum
/xtf:snippets/xtf:snippet[@rank='1']/@hitNum
I can't seem to get it to cough up just the 5. It would seem trivial,
but neither reference books nor any website I have found addressed it.
Any clues please, thanks.
.d
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






