Custom Web Publishing Guide

Table Of Contents
Chapter 3
|
Accessing XML data with the Web Publishing Engine 31
The <relatedset-definition> element represents a portal. Each related field in a portal is represented by the
<field-definition> element contained within the <relatedset-definition> element. If there are multiple related
fields in a portal, the field definitions for the related fields are grouped within a single
<relatedset-definition>
element.
<resultset> element
The <resultset> element contains all of the <record> elements returned as the result of a query and an attribute
for the total number of records found. Each
<record> element contains the field data for one record in the
result set—including the
mod-id and the record-id attributes for the record, and the <data> element containing
the data for one field in the record.
Each record in a portal is represented by a <record> element within the <relatedset> element. The count
attribute of the
<relatedset> element specifies the number of records in the portal, and the table attribute
specifies the table associated with the portal.
Example of XML data in the fmresultset grammar
The following is an example of XML data generated with the fmresultset grammar.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE fmresultset PUBLIC "-//FMI//DTD fmresultset//EN" "/fmi/xml/fmresultset.dtd">
<fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0">
<error code="0"></error>
<product build="06/15/2005" name="FileMaker Web Publishing Engine" version="8.0.1.32"/>
<datasource database="art" date-format="MM/dd/yyyy" layout="web3" table="art" time-format="HH:mm:ss"
timestamp-format="MM/dd/yyyy HH:mm:ss" total-count="16"/>
<metadata>
<field-definition auto-enter="no" global="no" max-repeat="1" name="Title" not-empty="no" result="text"
type="normal"/>
<field-definition auto-enter="no" global="no" max-repeat="1" name="Artist" not-empty="no" result="text"
type="normal"/>
<relatedset-definition table="artlocation">
<field-definition auto-enter="no" global="no" max-repeat="1" name="artlocation::Location"
not-empty="no" result="text" type="normal"/>
<field-definition auto-enter="no" global="no" max-repeat="1" name="artlocation::Date"
not-empty="no" result="date" type="normal"/>
</relatedset-definition>
<field-definition auto-enter="no" global="no" max-repeat="1" name="Style" not-empty="no" result="text"
type="normal"/>
<field-definition auto-enter="no" global="no" max-repeat="1" name="length" not-empty="no"
result="number" type="calculation"/>
</metadata>
<resultset count="1" fetch-size="1">
<record mod-id="2" record-id="3">
<field name="Title">
<data>Still Life with Apples, Cup and Glass</data>
</field>