please take a look at this custom function. If you don't have FM Advanced, you can still script the logic.
ParseValueByBookends ( $xmlResult; "<Cube currency='CZK' rate='"; "'/>")
Parsing XML with string functions is fine, but bound to go wrong somewhere.
The best way to do this is XSLT. This way you can import XML straight into your FileMaker table directly from am URL.
Check Import XML script step, xslt should be fairly simple for what you posted.
2 of 2 people found this helpful
this one may be simple enough and perhaps the custom functions would be sufficient?
a few more I found:
ExtractData ( XML ; Attribute ; Instance )
GetXMLNode ( XML ; XPath )
_XMLGetValue ( xml ; xpath )
The hardest part may be the XPath to the element(s) and/or attribute(s) whether using Custom Function or XSLT or even plugins.
The other part often is the namespaces in the source XML and XSLT needs to be mindful of them.
And does the parsing need to be multiple tables and/or fields? That may determine what works most efficiently.
Here is an XSLT that may help show the XPath & be sufficient to 'parse' a lot of XML:
kamal1234 might wish to try it and see.
Thank you very much for helping me. With combination of all three suggestions, I am able to extract data from attributes.
ok! very good.
please mark the question as answered (correct answer, even if on your own reply).