w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
A Simple Xpath to Google Spreadsheet ImportXML

The XPath expression:

/emd/result/rowset/row

will select a node-set containing all three rows. If you wish to select a particular row, you should attach a predicate [] containing the row you wish, for example:

/emd/result/rowset/row[2]

will select the second row.

To select an individual attribute from the selected row, you just need to add an extra location step containing the attribute name preceded by the @ sign. You can use expressions such as:

/emd/result/rowset/row[1]/@date
/emd/result/rowset/row[1]/@volume
/emd/result/rowset/row[1]/@orders

to obtain the contents of the date, volume and orders attributes of the first row, for example.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.