Brian Dunning's FileMaker Custom Functions

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

Steve Hearn   Steve Hearn
CoreSolutions Software Inc

Share on Facebook Share on Twitter

  Sample input:
ExtractXMLAttributeList__cf (
David ; "tag1" ; "" )
  Sample output:

  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)

-Important Notes-
Credit to Andy Knasinski, NRG Software ( for his function ExtractData ( XML ; Attribute ; Instance ) on which my function is based.



Bruce Robertson   Bruce Robertson
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.
comment   comment, VR
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:

<tag1 role="husband">Phillip</tag1>

The string "Phillip" is the TEXT CONTENT of the "tag1" element, while "husband" is the value of the "role" attribute.
Steve Hearn   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.
Jim   Jim, Newyork
Apr 6, 2016
Dosent work either!
Dosent any ever check their work?


with key SalesRank.
It will match on SalesRankings!!!

Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: