1

I'm trying to create an XSL that will convert FMPXMLRESULT file to a XFA compliant xml file. The purpose is to fill a pdf form.

The problem is all field names in Filemaker are different from the pdf form.

Here is a snippet of the fmpxmlresult file :

<?xml version="1.0" encoding="UTF-8" ?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>     
<PRODUCT BUILD="01-25-2011" NAME="FileMaker" VERSION="ProAdvanced 11.0v3"/>
<DATABASE DATEFORMAT="Yyyy-m-d" LAYOUT="" NAME="maisem" RECORDS="59" TIMEFORMAT="k:mm:ss "/>

<METADATA>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="reportCode" TYPE="TEXT"/>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="appraisalDate" TYPE="DATE"/>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="buildingValue" TYPE="NUMBER"/>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="landValue" TYPE="NUMBER"/>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="totalValue" TYPE="NUMBER"/>
    ...
</METADATA>
<RESULTSET FOUND="1">
    <ROW MODID="1156" RECORDID="119">
        <COL><DATA>TEST-141-361-2-0-A</DATA></COL>
        <COL><DATA>2011-02-10</DATA></COL>
        <COL><DATA>57000</DATA></COL>
        <COL><DATA>6500</DATA></COL>
        <COL><DATA>63500</DATA></COL>
        ...
    </ROW>
</RESULTSET>
</FMPXMLRESULT>

Here is the equivalent in XFA :

<?xml version="1.0" encoding="UTF-8"?>
<xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<form1>
    <subform>
        <reference_number>TEST-141-361-2-0-A</reference_number>
        <date_of_appraisal>2011-02-10</date_of_appraisal>
        <cityBuildingAssess>57000</cityBuildingAssess>
        <cityLandAssess>6500</cityLandAssess>
        <cityTotalAssess/>63500</cityTotalAssess>
        ...
    </subform>
</form1>
...
</xfa:data>

I have found examples where the fields have identical names, but it is not the case with the current system.

This is only a fraction of the fields. There are over 600 fields to fill in the form. So, I'm aware that this is going to be a huge job. :S

Thanks for any help

NickB
  • 349
  • 4
  • 15

1 Answers1

0

Here's an earlier answer that shows how to fetch column value by name. If your export file is flat, i.e. all data are in the same table, then the second example is all you need (it doesn't have the xsl:stylesheet, copy it from the question). Extend it to your 600 fields, matching FileMaker fields to PDF fields.

Community
  • 1
  • 1
Mikhail Edoshin
  • 2,639
  • 16
  • 25
  • The problem is that I don't know the order of the columns before exporting them. I tried the second example, but I could not make it work. – NickB Mar 05 '12 at 20:13