Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

ExtractXMLAttributeList__cf ( _xml ; _attribute ; _instance )

Rate this function:  

  Average rating: 4.5  (31 votes)
  Discuss this Custom Function

Steve Hearn, CoreSolutions Software Inc

Extracts a list of values that are contained within the XML attribute tag

Sample Input:
ExtractXMLAttributeList__cf (
<tag1>David</tag1> ; "tag1" ; "" )
Sample Output:

 Then copy & paste into FileMaker Advanced'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.

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

This is my Custom Function and I want to edit it


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.

Bruce Robertson, Redmond WA
November 19, 2010 12:45pm

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.

comment, VR
November 23, 2010 2:35am

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.

Steve Hearn, London ON
November 24, 2010 7:04am

Dosent work either!
Dosent any ever check their work?

<ProductCategor yId>music_display_on_website</ProductCategoryId>
< ;ProductCategoryId>1033930</ProductCategoryId>
<Rank>50< /Rank>
<ProductCategoryId> 1033714</ProductCategoryId>
</SalesR ank>
<ProductCategoryId>1033792</ProductCat egoryId>
</SalesRa nkings>

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

Jim, Newyork
April 06, 2016 9:36pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 5 + 5 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions