Custom Web Publishing Guide

Table Of Contents
Chapter 3
|
Accessing XML data with the Web Publishing Engine 33
To use the FMPXMLLAYOUT grammar, specify the following grammar name with the –view query command
in the URL requesting the XML document from the Web Publishing Engine:
FMPXMLLAYOUT.xml
For example:
http://192.168.123.101/fmi/xml/FMPXMLLAYOUT.xml?–db=employees&–lay=family&–view
Note When specifying the FMPXMLRESULT and FMPXMLLAYOUT grammars, be sure to enter the grammar
name in uppercase.
In the generated XML document, the Web Publishing Engine will reference the document type definition
for the grammar in the
<!DOCTYPE> instruction in the second line of the document, immediately after the
<?xml...?> instruction. The <!DOCTYPE> instruction specifies the URL for downloading the DTD for the
grammar.
Description of elements in the FMPXMLRESULT grammar
In the FMPXMLRESULT grammar, the <DATABASE> element contains the NAME, RECORDS,
DATEFORMAT, LAYOUT, and TIMEFORMAT attributes.
The DATEFORMAT attribute of the <DATABASE> element specifies the format of dates in the XML
document. The TIMEFORMAT attribute of the
<DATABASE> element specifies the format of times in the
XML document. The date and time formats for the
FMPXMLRESULT and the fmresultset grammars are the
same. See the tables in
“Description of elements in the fmresultset grammar” on page 30.
The <METADATA> element of the FMPXMLRESULT grammar contains one or more <FIELD> elements, each
containing information for one of the fields/columns of the result set—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 returned as the result of a query and an
attribute for the total number of records found. Each
<ROW> element contains the field/column data for one
row in the result set. This data includes the RECORDID and MODID for the row (see
“–modid
(Modification ID) query parameter” on page 96), and the <COL> element. The <COL> element contains the
data for one field/column in the row where multiple <DATA> elements represent one of the values in a
repeating or portal field.
Example of XML data in the FMPXMLRESULT grammar
The following is an example of XML data generated with the FMPXMLRESULT grammar.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE FMPXMLRESULT PUBLIC "-//FMI//DTD FMPXMLRESULT//EN" "/fmi/xml/FMPXMLRESULT.dtd">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="06/15/2005" NAME="FileMaker Web Publishing Engine" VERSION="8.0.1.32"/>
<DATABASE DATEFORMAT="MM/dd/yyyy" LAYOUT="web3" NAME="art" RECORDS="16"
TIMEFORMAT="HH:mm:ss"/>