Parsing xml file using xpath and xquery

wenmin

New Member
I have a xml file\[code\]<category> <type name="SWEATERS"> <product id =1> <itemNumber>1</itemNumber> <name>ProductA2</name> <price>345</price> </product> <product id=2> <itemNumber>4</itemNumber> <name>Product Test </name> <price>456</price> </product> </type></category>\[/code\]I used the xquery \[code\]$xml->xpath('//category/type/product[@id=1]');\[/code\]When i used this xquery iam getting only the name and price.How i can get the type name 'SWEATERS' along with name and price
 
Back
Top