Developer’s Guide

Table Of Contents
7-10 Developer’s Guide
<INPUT TYPE="TEXT" NAME="Address::City.2" VALUE="Santa
Clara">
<INPUT TYPE="SUBMIT" NAME="-edit" VALUE="Edit Record">
</FORM>
Using style sheets with your
XML document
The Web Companion will generate an XML-stylesheet processing
instruction with each grammar if the FileMaker CGI request includes
the –styletype and –stylehref parameters. This allows you to use
cascading style sheets (CSS) or Extensible Stylesheet Language
(XSL) documents for displaying your XML document.
The –styletype parameter is used for setting the value of the type
attribute (type=text/css or type=text/xsl).
The –stylehref parameter is used for setting the value of the HREF
attribute (href=document.css or href=document.xsl).
Here is an example of what a possible FileMaker CGI command
might look like:
http://localhost/fmpro?–db=employees.fp5&–format= –fmp_xml&–find=&
–styletype=text/xsl&–stylehref=document.xsl
Based on this command, the Web Companion will include the
following processing instruction in the XML document:
<?xml-stylesheet type=“text/xsl” href=“document.xsl”?>
The following text is an example of a possible XSL document used
with the FMPXMLRESULT grammar. In this example, the XSL
document converts the XML document into an HTML document by
inserting HTML tags. It builds an HTML table that contains a header
row for all the field names from the METADATA element in the
FMPXMLRESULT grammar, and table rows for all the field data in
the ROW elements of the RESULTSET.
Note This is an example of XSLT that was written to work with
Internet Explorer 5.0 for Windows, not with other browsers using
later versions of XSLT.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3c.org/TR/WD-xsl"
xmlns:HTML="http://www.w3c.org/Profiles/XHTML-transitional">
<xsl:template>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of/>
</xsl:template>
<xsl:template match="/">
<HTML>
<BODY>
<CENTER>
<TABLE BORDER="0">
<xsl:apply-templates/>
</TABLE>
</CENTER>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="ERRORCODE">
</xsl:template>
<xsl:template match="METADATA">
<TR>