You can use xmlFM to parse any XML document within FileMaker in order to get :
- element content
- attribute value
Advantages
In contrast to several other existing FileMaker solution, xmlFM has the following advantages :
- xmlFM is compatible with a wide selection of FileMaker versions
- xmlFM does NOT need any plugin to be installed, neither to be deployed !
It is just a set of FileMaker scripts installed in about 30 seconds !
- xmlFM does not need any internet connection to work. It is 100% offline !
- xmlFM is robust and it supports perfectly comments, and attributes in the XML document. Try it here.
- xmlFM handles correctly empty-element tag (as <line-break />)
Example
Imagine you have the following XML file :
<Document>
<Item>
<MsgId>Message 1</MsgId>
<!– comment are ignored correctly –>
<MsgId>Message 2</MsgId>
<!– multiline comment are ignored correctly
<MsgId>Message WRONG</MsgId>
–>
<!– attributes are managed correctly –>
<MsgId Ccy= »ENGLISH »>Message 3</MsgId>
</Item>
</Document>
You want to obtain the element content « Message 3 » and its attribute « ENGLISH » ? The solution is xmlFM :
GetXMLNode( /Document[1]/Item[1]/MsgId[3] )
Some explanations, the previous syntax is for :
- Go to first occurence of root tag « Document«
- Then, go to its first child tag named « Item«
- Finally, go to the third occurence of it child, with the tag named « MsgId«
From there you will get the element content : « Message 3 », and its attribute : « ENGLISH ».