Filemaker-to-XML conversions
So, let's say you have a database of information in Filemaker (or Excel or some other simple database or spreadsheet). Converting to XML is a breeze! Jim Hart has a lot of experience building custom programs to do the conversion. But you can do it yourself using XML Spy software by Altova GambH & Altova Inc.
Using XML Spy to do the conversion:
XML Spy has a nifty text-to-xml feature. So all you have to do is get your Filemaker data into a text format. However, I noticed that Filemaker Pro 5 won't export your field names along with the data; that's a problem because you want the field names to become XML element names. (Check to see if this export issue is still present in the current version of Filemaker you are currently using.) Exporting as HTML preserves the field names; so do this first, and use Microsoft Excel to convert to text.
| Step | What to do | Details |
|---|---|---|
| 1 | Open the database in Filemaker and show all records (or just the records you want to export) | |
| 2 | Export from Filemaker as HTML and show all records (or just the records you wish to export | Choose what fields you wish to export (or select "move all"); each field becomes an element name; If you don't need to export field names, export as text and go to step 5 |
| 3 | Open the HTML file in Excel | |
| 4 | Save as text only, tab delimited | |
| 5 | Import into XML Spy | In XML Spy, choose CONVERT / IMPORT TEXT FILE; choose the text file |
| Field delimiter: tab; First Row Contains Field Names: check ON Character encoding: none seem perfect, but "codepage 1252 Western" seems to offer the fewest problems |
||
| 6 | Check data preview to see that fields are as expected. You have the option to set attributes and elements, or skip over data elements entirely. We recommend you DON'T use attributes; there doesn't seem to be any reason to use them. | <> By default all fields are elements = Click on the icon to set as an attribute x Click again to not import the data |
| 7 | Clean up file | Delete any blank rows (search for <row/> |
| Fix character entities | Worst offenders are emdash (—) and apostrophe (’). Also check for Spanish, French characters. There are several good character entity charts online. |
|
| 8 | Save in Prebuilt folder | |
| 9 | Insert the XML file in Publisher page using an Insert component | Use an Insert component Well-formed: true |
| 10 | display XML content by using the appropriate x-path; XML Spy will always call each record "Row" | for example: <xsl:value-of select="/Story/Thesis/Import/Row/Last_Name" /> |