Can you parse out XML data in FileMaker Pro in one step?
If you regularly have to work with XML formatted data in FileMaker Pro®, getting the relevant parts of that data, and putting it into text fields can be a daunting task.
And you would probably say it is impossible to get a node of the XML out in one step as it would need a lot of script steps. But that is not the case if you use a plug-in.
Yes, it can be done!
It can be done if you install Troi Text Plug-in. This plug-in adds a function TrText_XML( ) to your arsenal of tools.
This function allows you to easily parse out a node from XML in one step! Here is the syntax of this function:
TrText_XML ("-GetNode" ; Node_to_get ; XML_data )
The function has three parameters: the first parameter specifies the action to take, in this case to get a node from the XML. The second parameter specifies which node you want to get. Finally the third parameter is the XML data you want to parse.
The result of the TrText_XML function will be the text of the node you are interested in. You can use this function in a script, for example in a Set Variable step.
You may not realize this, but you can also put this function in a calculation field: this will make the function recalculate automatically if one of the parameters changes, always giving the right result.
Defining the calculation field
Let’s make this concrete: assume your database already contains a text field XML_data, in which the XML formatted text is stored. You need to define three extra fields:
Node_to_get, text field
Node_data, a calculation field
Attribute_data, a calculation field (optionally, if you need attribute data)
In the field Node_to_get you can now specify the nodes and sub-nodes separated by a slash, like “main node/sub node/subsub node”.
Assume that in this example you are interested in this node path:
transaction/product/name
If you enter this node path in the Node_to_get field the TrText_XML function returns: “Super Plug-in”.
Not all XML data has attributes, but in this case it does, and in the Attribute_data field the attribute data “version=3.5” is returned.
And the advantage of this implementation is that it always works: when the XML_data field changes, the calculation will automatically update and the result will show correctly on the layout.
Play with the example and demo plug-in
The Troi Text Plug-in comes with multiple example files, which demonstrate the functionality of all functions of the plug-in. Below you can see the example file ParseXML.fmp12, with the data of our example:
If you have not done so already, you should download the fully functional demo version of the plug-in and play with it to see how easy it makes parsing XML.
More functions for FileMaker Pro 14
The TrText_XML function is just one of the functions added by Troi Text Plug-in. The plug-in also adds functions for manipulating 2 fields of data (AND/OR/XOR) and more. It is rewritten to support 64-bit and is compatible with FileMaker Pro 12 to FileMaker Pro 14.
On the Troi Text Plug-in page you can download a fully functional demo with all the functions explained here:
www.troi.com/software/textplugin.html
We are sure that this plug-in will speed up your work with text data.
Today we released an updated version of Troi File Plug-in, our plug-in for manipulating external files and folders directly from FileMaker Pro. This is a maintenance update, which has a few bugfixes and improvements in the Search, GetDate and Metadata functions. Upgrading to version 8.0.1 is free for all users of version 8.0.
More info here: www.troi.com/software/fileplugin.html
Troi Automatisering releases Troi Activator, Dialog and URL Plug-in for FileMaker Pro 14
Updated plug-ins add support for 64-bit architecture with FileMaker
Pro 14
Alphen aan den Rijn, The Netherlands, May 12th, 2015--Troi Automatisering today announced the immediate availability of Troi Activator Plug-in 3.6, Troi Dialog Plug-in 6.1 and Troi URL Plug-in 4.1 for FileMaker Pro 14.
What is new in Troi Activator Plug-in 3.6?
Troi Activator Plug-in is a very powerful tool for triggering scripts across the network, even over the Internet. Version 3.6 fixes a bug that could make FileMaker Pro 14 crash when showing a flash dialog.
A fully functional demo version of Troi Activator Plug-in 3.6 is available for downloading at Troi's Web site at: http://www.troi.com/software/activatorplugin.html
The upgrade to version 3.6 is free for all users of version 3.5.x. The 3.6 version works with the 3.5 version of the registration.
Upgrade prices from older licenses can be found on our web site. You can order upgrades from our web site.
What is new in Troi Dialog Plug-in 6.1?
Troi Dialog Plug-in is a very powerful tool for displaying all sorts of dialogs in FileMaker Pro. The text of the dialog and of the buttons can be created dynamically by using a calculation. Version 6.1 is the first 64-bit compatible version of Troi Dialog Plug-in. New features include the possibility to return the text of the button that was clicked in the Dial_Dialog function.
A fully functional demo version of Troi Dialog Plug-in 6.1 is available for downloading at Troi's Web site at: http://www.troi.com/software/dialogplugin.html
The upgrade to version 6.1 is free for all users of version 6.0. The 6.1 version works with the 6.0 version of the registration.
Upgrade prices from older licenses can be found on our web site. You can order upgrades from our web site.
What is new in Troi URL Plug-in 4.1?
Troi URL Plug-in can help you fill in forms on the Internet, all from FileMaker Pro. It also retrieves data or images from web sites. Version 4.1 fixes a bug that could make FileMaker Pro 14 become unresponsive after calling the TURL_Get and TURL_Post functions.
A fully functional demo version of Troi URL Plug-in 4.1 is available for downloading at Troi's Web site at: http://www.troi.com/software/urlplugin.html
The upgrade to version 4.1 is free for all users of version 4.0. The 4.1 version works with the 4.0 version of the registration.
Upgrade prices from older licenses can be found on our web site. You can order upgrades from our web site.
Pricing & Availability
Details on pricing, developer licenses and multi-user discounts can be found on our web site. You can order licenses from our web site.
All three updated plug-ins work with FileMaker Pro 12, 13 and 14. The plug-ins can also be used with runtimes from FileMaker Pro Advanced 12, 13 and 14. The plug-ins are available for OS X 10.6.x or higher, Windows Vista, Windows 7, Windows 8 and Windows 8.1.
FileMaker Server requirements
Troi Activator Plug-in 3.6 and Troi URL Plug-in 4.1 also work with FileMaker Server 12, 13 and 14 as a server-side plug-in and as a plug-in used by the web publishing engine and WebDirect. To use this, you need to purchase a special cross-platform Server/Web license.
We have prepared extensive information on how to install and use Troi Plug-ins server-side and web-side on this web page:
http://www.troi.com/support/filemaker-server-side-plug-ins.html
About Troi Automatisering
Troi Automatisering develops professional iOS apps, is a leading developer of cross platform FileMaker Pro plug-ins and winner of the FileMaker Pro Excellence Award 2001. For more information, visit our web site at:
http://www.troi.com/