计算<price>跟<availability>两个值相乘,用xpath如何表示?
- XML code
<?xml version="1.0" encoding="iso-8859-1"?> <catalog xmlns="urn:mycompany:examples:plants"> <plant> <common>Bloodroot</common> <botanical>Sanguinaria canadensis</botanical> <zone>4</zone> <light>Mostly Shady</light> <price>2.44</price> <availability instock="yes">100</availability> </plant> </catalog>
------解决方案--------------------
XPATH : number(//price) * number(//availability)