Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Queries value in XML.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
XML 7.4 Yes Yes Yes Yes Yes

MBS( "XML.GetPathValue"; XML; Path { ; Flags } )


Parameter Description Example value
XML The XML to process.
Can be XML as text or the reference returned by XML.Parse function, so you can make several times queries to the XML without parsing it each time.
Path The path to the node or attribute to query. "name"
Flags Optional
Various Flags.
Add 1 to ignore errors in xml and continue parsing. This may lead to not everything in the xml being read.
Add 2 to return empty text instead of errors.
Add 4 to format returned XML.
Add 32 to return result as XML, if it’s more than just a text.


Returns text or error.


Queries value in XML.
This function uses a path notation like the JSON functions in FileMaker to describe paths.
You can use name of a node followed by option index in square brackets. On the end you can use # followed by a name of an attribute to select only the attribute.
Delimiter between items can be dot like FileMaker or newline.


Return test node value:

MBS( "XML.GetPathValue"; "<test>Hello</test>"; "test"; 0)

Example result: "Hello"

Query value of attribute:

MBS( "XML.GetPathValue"; "<test id=\"123\">Hello</test>"; "test#id")

Example result: "123"

Query value of node:

MBS( "XML.GetPathValue"; "<outer><inner>Hello</inner></outer>"; "outer.inner")

Example result: "Hello"

Query subtree as XML:

MBS( "XML.GetPathValue"; "<outer><middle><inner>Hello</inner></middle></outer>"; "outer.middle"; 32+4)

Example result:
"<?xml version="1.0" encoding="UTF-8"?>

Query items with index:

MBS( "XML.GetPathValue"; "<people><personid>123</personid><personid>456</personid><personid>789</personid></people>"; "people.personid[2]"; 0)

Example result: "789"

Query value from complex XML:

MBS("XML.GetPathValue"; XML::BKML_data; "[0].citystatezip";0)

See also

XML.GetAttribute   -   XML.HasAttribute

Feedback: Report problem or ask question.

MBS FileMaker Plugins