Developer’s Guide

Table Of Contents
Using FileMaker Pro XML to deliver your data on the Web 10-13
4. On the Default.htm page, click the links to the CSS, XSL, and
Scripting/DOM examples, or view the source to see the FileMaker Pro
CGI requests for the links.
See “Generating FileMaker Pro CGI requests for an XML
document” on page 10-8 for information.
Cascading style sheets (CSS) example
Cascading style sheets (CSS) documents format the text style (font,
size, color, etc.) and positioning of your data in an XML document.
A cascading style sheet can only be applied to the existing data in an
XML document—it cannot be used to transform the data (such as
transforming a URL for a container field into its corresponding
image), or to add additional information (such as labels for each
field) to the XML document.
This example demonstrates the use of a CSS document with an XML
document. The following CGI command was used to generate the
FMPDSORESULT grammar for the People.fp5 database and to
apply the People_form.css stylesheet to the generated XML data:
fmpro?–db=people.fp5&–lay=xml form&–format=dso_xml&
–styletype=text/css&–stylehref=people_form.css&–max=1&–nd=
To simulate field labels, the CSS document applies boldface
and right-alignment to data in the three global fields
The picture in the container field is not displayed in this example
because the CSS document can only apply styles to the existing data
(the relative URL to the image). It’s not possible to transform the
URL into its corresponding image using cascading style sheets.
The following text is the people_form.css stylesheet, which adds
formatting and positioning to the XML:
/*
* Since FMPDSORESULT is the root element of the XML document,
* any formatting applied to this element will cascade down to all
* other elements in the document. This is a good place to set the
* default formatting options for your page.
*/
FMPDSORESULT
{
font-family: sans-serif;
font-size: 10pt;
}
/*
* Don't display the data for these elements.
*/