The XPath @root-node-position attribute info
- by Igor Savinkin
I couldn't find the @root-node-position XPath attribute info. Would you give me a link of where i can read about it? Is it XPath 2.0?
The code (not mine) is ../preceding-sibling::div[1]/div[@root-node-position]/div applied to this HTML:
<div class="left">
<div class='prod2'>
<div class='name'>Dell Latitude D610-1.73 Laptop Wireless Computer
</div>2 GHz Intel Pentium M, 1 GB DDR2 SDRAM, 40 GB
</div>
<div class='prod1'>
<div class='name'>Samsung Chromebook (Wi-Fi, 11.6-Inch)
</div>1.7 GHz, 2 GB DDR3 SDRAM, 16 GB
</div>
</div>
<div class="right">
<div class='price2'>$239.95</div>
<div class='price1 best'>$249.00</div>
</div>
Firstly i fetch a price text under class='right' with this query : //DIV[contains(@class,'best')] and then i apply the above mentioned XPath with @root-node-attribute under class='left' to retrieve the rest of the record info.