Custom Web Publishing Guide

Table Of Contents
50 Custom Web Publishing Guide
Specifying an XML grammar for a FileMaker XSLT stylesheet
The recommended XML grammar to use with Custom Web Publishing with XSLT is the fmresultset grammar,
which has been designed for ease of use with XSLT. See “Using the fmresultset grammar” on page 27. You
can also use the older FMPXMLRESULT or FMPXMLLAYOUT grammars. To access value lists and field
display information in layouts, you must use the FMPXMLLAYOUT grammar. See
“Using other FileMaker
XML grammars” on page 29. You cannot use the FMPDSORESULT grammar with Custom Web Publishing
with XSLT.
To specify the grammar for a FileMaker XSLT stylesheet, use the –grammar query parameter in a URL or as
a statically defined query parameter in the
<?xslt-cwp-query?> processing instruction.
For example:
http://192.168.123.101/fmi/xsl/my_template/my_stylesheet.xsl?-grammar=fmresultset&-db=mydatabase
&-lay=mylayout&-findall
Or
<?xslt-cwp-query params="-grammar=fmresultset&-db=mydatabase&-lay=mylayout&-findall"?>
Important If you don’t specify an XML grammar for a FileMaker XSLT stylesheet, the error “QUERY -
ER0001” is displayed. See
appendix B, “Error codes for Custom Web Publishing.”
About namespaces and prefixes for FileMaker XSLT stylesheets
Unique XSLT namespaces help distinguish XSLT tags by the application they were designed for. In the
<xsl:stylesheet> element at the start of all FileMaker XSLT stylesheets, declare the namespaces for the
FileMaker XSLT extension functions and the particular grammars you are using in the stylesheet.
You must also declare the following required namespace in each FileMaker XSLT stylesheet:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Here is an example of namespace declarations:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmrs="http://www.filemaker.com/xml/fmresultset"
xmlns:fml="http://www.filemaker.com/fmpxmllayout"
xmlns:fmq="http://www.filemaker.com/xml/query"
xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions"
exclude-result-prefixes="xsl fmrs fmq fml fmxslt">
If you use this Declare this namespace
Use this
prefix
fmresultset XML grammar xmlns:fmrs="http://www.filemaker.com/xml/fmresultset" fmrs
FMPXMLRESULT grammar xmlns:fmp="http://www.filemaker.com/fmpxmlresult" fmp
FMPXMLLAYOUT grammar xmlns:fml="http://www.filemaker.com/fmpxmllayout" fml
For the query XML grammar xmlns:fmq="http://www.filemaker.com/xml/query" fmq
For the FileMaker XSLT extension
functions
xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions" fmxslt