Brian Dunning's FileMaker Custom Functions

XML_Get ( InXML ; InElement ; InOccurrence )

Returns the text between the Elements tags, for the given Occurrence

  Be the first to rate this function Log in to vote

Richard DeShong   Richard DeShong - Show more from this author
Logic Tools
http://logictools.com

Share on Facebook Share on Twitter

  Sample input:
XML_Get ( $xml ; "E2" ; 1 ),
where $xml is xml text with an E2 element.
  Sample output:
"B"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Given the xml, the element, and the occurrence, returns the text within the element.

There are two error conditions:
Error 1) the element is not found. Returns "Empty".
Error 2) the element "close" tag is found before the "open" tag. Returns "Empty".
If you want to receive error messages, then replace "Empty" as appropriate.

If there is no data between the element tags, then returns "Empty".
If you want to receive nothing if there is no data, then replace "Empty" with "".

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 20 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: