Even if you don't ever plan to create a single XSLT, XML is a valuable tool when working with FileMaker. It provides a reliable method for transferring data with a minimum of muss and fuss.
Here, we show you how to transform contact information in FileMaker into VCF (the vCard format used by many PIMs) and transfer it to an iPod for use with the Contacts feature, which allows you to view (but not edit) name and address information.
For this example, you'll need to visit [ www.filemaker.com/technologies/xslt_librar225 ]. You'll find a link there to VCFExport, a zipped folder that holds an XSLT called fmp2vcf.xsl, a .fp5 file with standard contact fields and accompanying documentation.
1 .
Open the file containing the names and addresses you'd like to transfer to the iPod.
2 .
Choose Record > Show All Records (Control+J/Command+J) so you'll export the entire file, then choose File > Export Records.
If you only want selected records to be transferred, or want the records sorted a specific way, create your Finds and Sorts before you export the records.
3 .When the Export Records to File dialog box appears, type export.vcf for the file name. In the Type pop-up menu, choose XML (Figure 12.58). Click Save.
4 .When the Specify XML and XSL Options dialog box appears, click the "Use XSL style sheet" check box (Figure 12.59).
5 .Click the File radio button, then click Specify. When the Open dialog box appears, navigate to the fmp2vcf.xsl style sheet that you downloaded. Double-click to open it.
6 .Back in the Specify XML and XSL Options dialog box, click Continue (Figure 12.60).
7 .Next you'll want to export only those fields that the iPod's Contacts database can support. When the Specify Field Order for Export dialog box appears, double-click the fields with the following data in the left box:
First Name Last Name Title Company Phone 2 (or home) Phone 1 (or office) Phone 3 (or mobile) Email URL Address 1 (work address) City 1 State 1 Zip Code1 Address 2 (home address) City 2 State 2 Zip Code2 Notes
You can change the field export order by dragging the field name up or down in the Field export order window. You can also keep fields together by selecting those fields at the same time and clicking Move.
8 .When finished, click the Export button (Figure 12.61).
9 .Copy the export.vcf file to the Contacts folder on your iPod (Figure 12.62). All of that information from your FileMaker database is now available in the Contacts feature of the iPod.
This is but one of many tasks that can be accomplished using XSLTs with your FileMaker data. Check the XML section of the FileMaker Web site for many more.
The export.vcf file created in this section is compatible with any address book programs that use the vCard format. Check your software for details.
If you're going to be using XML with FileMaker, at some point you may need an XSLT that doesn't already exist. There are a number of resources available to help you learn how to create your own XSLT. FileMaker Developer's Edition has extensive documentation and sample files. The FileMaker Web site has an entire section devoted to XML ([ www.filemaker.com/technologies ]).
As with any programming language, the best way to get started learning is to look at code that others have created. You can open a style sheet in a text editor to see how it works and even adapt it for your own purposes.