ExtractXMLAttributeList__cf ( _xml ; _attribute ; _instance )
Extracts a list of values that are contained within the XML attribute tag
Average rating: 4.5 (31 votes) Log in to vote
CoreSolutions Software Inc
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Recursive function to extract a list of values that are contained within the XML attribute tag.
_xml - the source containing the XML data
_attribute - the XML tag to search for
_instance - the occurrance number to extract up to OR leave blank to extract a list (a value of 2 will produce a list of the first 2 occurrences)
Credit to Andy Knasinski, NRG Software (http://www.nrgsoft.com/) for his function ExtractData ( XML ; Attribute ; Instance )
Nov 19, 2010
|Can't see any advantage here and it seems confusing. If you enter 2 for the instance you do not get instance 2, you get the first two instances? When do you ever get what you ask for? Seems like you should be processing instances as a list.|
Nov 23, 2010
|A semantic note:
The use of the word "attribute" is incorrect and misleading. In the given example, "tag1" is the name of an ELEMENT. An element can have attributes, for example:
The string "Phillip" is the TEXT CONTENT of the "tag1" element, while "husband" is the value of the "role" attribute.
|Steve Hearn, London ON
Nov 24, 2010
|Thanks for the feedback Bruce.
I use this CF to obtain a list of all the field names, for instance, that I copy from a layout. I use ClipMgr to expose the XML then paste it in a little utility file with this CF and key in the tag I want and leave the instance blank. It's true that you get a list up to the instance you specify; if you want just the instance I guess you'd want to use Andy Knasinski's function, on which this one is based.
Apr 6, 2016
|Dosent work either!
Dosent any ever check their work?
with key SalesRank.
It will match on SalesRankings!!!
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.