Created
March 3, 2016 05:03
-
-
Save codenameone/966f9061a610330f5d03 to your computer and use it in GitHub Desktop.
Sample usage of the XPath processing package in Codename One
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
Result result = Result.fromContent(input, Result.XML); | |
String country = result.getAsString("/result/address_component[type='country']/long_name"); | |
String region = result.getAsString("/result/address_component[type='administrative_area_level_1']/long_name"); | |
String city = result.getAsString("/result/address_component[type='locality']/long_name"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This sample was designed to work with this gist https://gist.github.com/codenameone/6470330d1a30d30760ed
Sample code for using the Result class.
From the Codename One project