GetXMLNode ( XML ; XPath )
Navigate XML tree and return results using XPath type functionality (Nonrecursive)
Average rating: 4.1 (43 votes) Log in to vote
Michael Wallace - Show more from this author
Empowered Data Solutions http://empowereddatasolutions.com |
GetXMLNode ( XMLfield ; "/class[1]/student[1]" ) & "¶" &
GetXMLNode ( XMLfield ; "/class[1]/student[2]" )
Sue
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Navigate XML tree and return results using XPath type functionality.
Parameter Description
XML - vanilla xml imput without attributes
XPath - basic XPath like syntax consiting of a series of xml nodes formatted as follows:
/nodeName[instanceNumber]
Requires ExtractData ( XML ; Attribute ; Instance ) by Andy Knasinski of NRG Software which can be found at http://www.briandunning.com/cf/1
Thanks to Andy for the great base function!
This function is not recursive. It simply creates multiple nested instances of ExtractData in a calculation string and then evaluates it to get the data.
*************
EXAMPLE USE
*************
XMLfield is set to:
GetXMLNode ( XMLfield ; "/class[1]/teacher[1]/name[1]" ) & "¶" &
GetXMLNode ( XMLfield ; "/class[1]/students[1]/student[2]/age[1]" ) & "¶" &
GetXMLNode ( XMLfield ; "/class[1]/students[1]/student[1]" )
Will produce the following:
Kelly
16
Comments
Bruce Robertson Feb 16, 2009 |
||
Trailing section of example is incorrect, <class> should be </class> | ||
Michael Wallace, Empowered Data Solutions Feb 26, 2009 |
||
Thanks Bruce, correction made. | ||
Bruce Robertson Nov 1, 2013 |
||
No, it has not been corrected, in the Sample Input section here where you state "XMLfield is set to: … " | ||
Simon Plint, Australia Oct 26, 2014 |
||
"Nonrecursive, this function simply creates multiple nested instances of GetXMLData in a calculation string and then evaluates it to get the data." Don't you mean ExtractData instead of GetXMLData? |
||
Mike Wallace, Dallas Texas Apr 27, 2015 |
||
Fixed the typo in the description. Thanks Simon. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.