XML FMPXMLRESULT grammar
The FMPXMLRESULT grammar contains additional information about the database that is not in the FMPDSORESULT grammar, such as the number of records, field types, and field formats. These elements and attributes are necessary for the
XML to validate properly.
Use the FMPXMLRESULT grammar if you require the METADATA information provided by this grammar. Because FileMaker Pro supports both importing and exporting in the FMPXMLRESULT grammar, this can be a useful format for transferring data between FileMaker Pro files.
The METADATA element contains one or more FIELD elements, each containing information for one field/column — including the name of the field as defined in the database, the field type, the Yes or No allowance for empty fields (EMPTYOK attribute), and the maximum number of repeating values (MAXREPEAT attribute). Valid values for field types are TEXT, NUMBER, DATE, TIME, TIMESTAMP, and CONTAINER.
The RESULTSET element contains all of the ROW elements that specify the record data in the XML. Each ROW element contains the field/column data for one row in the result set — including the record ID for the row, the modification ID for the row, and the COL element containing the data for one field/column in the row (where multiple DATA elements represent one of the values in a repeating or portal field).
The order of the COL elements corresponds with the order of the FIELD elements in the METADATA element, for example, where the "First Name," "Last Name," and "Department" elements are listed in the METADATA, "Joe," "Smith," and "Engineering" are listed in the same order in the RESULTSET ROW.
•
|
Before importing the XML, FileMaker Pro uses a Xerces-based XML parser and a Xalan-based XSLT processor to apply an XSLT style sheet (if you specified one) to transform the XML data. If an error message appears, correct the error and try importing again.
|
•
|
Though the XML that you import must conform to the FMPXMLRESULT grammar, certain elements and attributes are not used during import. The following table defines which elements and attributes are used during XML import, and lists the allowed default values for attributes. In most cases, attribute values may be null (such as TIMEFORMAT=""). Also, the FMPXMLRESULT element should always declare the FileMaker namespace for the grammar.
|
The following is an example of XML data in the FMPXMLRESULT grammar. For complete details on the document type definition (
DTD) for the grammar, see the
fmpxmlresult_dtd.htm file, in the Extras folder for your language where the FileMaker Pro application is installed. For example, FileMaker Pro > English Extras > Examples > XML Documentation folder.
<?xml version="1.0" encoding="UTF-8"?><FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="5/23/2002" NAME="FileMaker Pro"
VERSION="7.0"/>
<DATABASE DATEFORMAT="MM/dd/yy" LAYOUT="summary"
NAME="Employees.fmp12" RECORDS="23" TIMEFORMAT="hh:mm:ss"/>
<METADATA>
<FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="First Name" TYPE="TEXT"/>
<FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Last Name" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Department" TYPE="TEXT"/>
</METADATA>
<RESULTSET FOUND="2">
<ROW MODID="47" RECORDID="34">
<COL>
<DATA>Joe</DATA>
</COL>
<COL>
<DATA>Smith</DATA>
</COL>
<COL>
<DATA>Engineering</DATA>
</COL>
</ROW>
<ROW MODID="89" RECORDID="78">
<COL>
<DATA>Susan</DATA>
</COL>
<COL>
<DATA>Jones</DATA>
</COL>
<COL>
<DATA>Marketing</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>