This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id[] = result.getAsIntegerArray("//player[middlename]/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id[] = result.getAsIntegerArray("//player[@rank=null]/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id[] = result.getAsIntegerArray("//player[@rank]/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String id=result.getAsInteger("//player[//address[country/isocode='CA']]/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id = result.getAsInteger("//player[lastname='Hewitt']/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id = result.getAsInteger("//lastname[text()='Hewitt']/../@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String first2[] = result.getAsStringArray("//player[position() < 3]/firstname"); | |
String secondLast = result.getAsString("//player[last() - 1]/firstName"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int top2[] = result.getAsIntegerArray("//player[@rank < 3]/@id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rankings type="aus" gender="male" date="2011-12-31"> | |
<player id="1036" coretennisid="6752" rank="1" delta="0" singlespoints="485000" doublespoints="675" deductedpoints="0" totalpoints="485675"> | |
<firstname>Bernard</firstname> | |
<lastname>Tomic</lastname> | |
<town>SOUTHPORT</town> | |
<state>QLD</state> | |
<dob>1992-10-21</dob> | |
</player> | |
<player id="2585" coretennisid="1500" rank="2" delta="0" singlespoints="313500" doublespoints="12630" deductedpoints="0" totalpoints="326130"> | |
<firstname>Mathew</firstname> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get all address_component names anywhere in the document with a type "political" | |
String array[] = result.getAsStringArray("//address_component[type='political']/long_name"); | |
// get all types anywhere under the second result (dimension is 0-based) | |
String array[] = result.getAsStringArray("/result[1]//type"); |