Developer’s Guide

Table Of Contents
Using FileMaker Pro XML to deliver your data 7-5
When you specify “–fmp_xml” as the format for a FileMaker Pro
CGI request, the Web Companion will generate XML data using
either the FMPXMLRESULT or FMPXMLLAYOUT grammar,
depending on the request you specify in the CGI command:
1 The Web Companion will generate the FMPXMLRESULT
grammar when you specify –edit, –delete, –find, –new,
–dbnames, –layoutnames, –scriptnames or –dbopen as the
FileMaker CGI request.
1 The Web Companion will generate the FMPXMLLAYOUT
grammar when you specify –view as the FileMaker CGI request.
The Web Companion will also generate the document type definition
for the grammar if you specify “–fmp_xml_dtd” as the format. This
is useful if you want an XML parser to validate the XML before your
document goes to production.
For a list of valid FileMaker CGI requests, see “Generating
FileMaker Pro CGI requests for an XML document” on page 7-8.
Note When using XML grammars, you should do a case-insensitive
compare for proper results.
Description of elements in the FMPXMLRESULT grammar
In the generated FMPXMLRESULT grammar, the DATABASE
element contains attributes for the name of the database, the number
of records in the database, the name of the layout that was used to
generate the result set, and the format of dates and times in the XML
document.
The DATEFORMAT attribute specifies the format of dates in the
XML document.
The TIMEFORMAT attribute specifies the format of times in the
XML document.
The METADATA element 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, 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—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).
Note The content of container fields in the database will be
generated in the form of the relative URL used for retrieving the
content, instead of the actual content (such as an image).
Field Full form Short form
Year yyyy (4 digits) yy (2 digits)
Month mm (2 digits) M (1 or 2 digits)
Day dd (2 digits) d (1 or 2 digits)
Field Full form Short form
Hour (1 – 12) hh (2 digits) h (1 or 2 digits)
Hour (1 – 24) kk (2 digits) k (1 or 2 digits)
Minute mm
Second ss
AM/PM a
Field Full form Short form