GetValuesFromXML
Returns all element or attribute values with a specified name.
-
Output
- Result The element or attribute values.
-
Code
-
// Instantiate the Choreo, using a previously instantiated TembooSession object, eg: // TembooSession session = new TembooSession("kailashkatheth", "myFirstApp", "12fa8651ae034100afc50b3f9706ccd9"); GetValuesFromXML getValuesFromXMLChoreo = new GetValuesFromXML(session); // Get an InputSet object for the choreo GetValuesFromXMLInputSet getValuesFromXMLInputs = getValuesFromXMLChoreo.newInputSet(); // Set inputs // Execute Choreo GetValuesFromXMLResultSet getValuesFromXMLResults = getValuesFromXMLChoreo.execute(getValuesFromXMLInputs);
-
-
Notes
-
This Choreo returns all element or attribute values with a specified name.
Here's an example of two row entries returned from the Google Spreadsheets API which could be used as the XML input:
<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"> <id>https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g</id> <updated>2013-07-31T20:05:13.836Z</updated> <category scheme="http://schemas.google.com/spreadsheets/2006" term="http://schemas.google.com/spreadsheets/2006#list"/> <title type="text">john</title> <content type="text">lname: johnson, email: [email protected]</content> <link rel="self" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g"/> <link rel="edit" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g/117ip4mm5fnol"/> <gsx:fname>john</gsx:fname> <gsx:lname>johnson</gsx:lname> <gsx:email>[email protected]</gsx:email> </entry> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"> <id>https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g</id> <updated>2013-07-31T20:05:13.836Z</updated> <category scheme="http://schemas.google.com/spreadsheets/2006" term="http://schemas.google.com/spreadsheets/2006#list"/> <title type="text">john</title> <content type="text">lname: johnson, email: [email protected]</content> <link rel="self" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g"/> <link rel="edit" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/0ArNdNVaZJYRqdGJiZ3M3MEE2ZU42NUlLcFlOTHdlN1E/od6/private/full/ckd7g/117ip4mm5fnol"/> <gsx:fname>stan</gsx:fname> <gsx:lname>standley</gsx:lname> <gsx:email>[email protected]</gsx:email> </entry> </feed>
If for example, you wanted to extract the email addresses from this response, you could provide the following inputs:
Node: gsx:email
ResponseFormat: csv
The following is a sample of the data returned when the ResponseFormat is set to "csv":
john@temboo.com stan@temboo.com
The following is a sample of the data returned when the ResponseFormat is set to "json":
[ "[email protected]", "[email protected]" ]
-
This Choreo returns all element or attribute values with a specified name.
- Get link
- Other Apps
Comments
Post a Comment