Custom Web Publishing Guide

Table Of Contents
Developing FileMaker XSLT stylesheets 55
Accessing the query information in a request
You can use a FileMaker XSLT parameter to access query information in a request in a URL or HTML form
data. For example, you can access the current request query information to determine the current location in a
found set of records, and create links to the previous and next record.
The following FileMaker XSLT parameter provides access to all of the query commands and query parameters
that are used to request FileMaker XML data via the Web Publishing Engine:
<xsl:param name="request-query"/>
With the exception of field names, the Web Publishing Engine returns all query command and query parameter
names in lowercase. The capitalization of field names is preserved.
An XML document fragment is loaded into the request-query parameter in the following grammar:
<!DOCTYPE query [
<!ELEMENT query (parameter)*>
<!ATTLIST query
action CDATA #REQUIRED>
<!ELEMENT parameter (#PCDATA)>
<!ATTLIST parameter
name CDATA #REQUIRED>
]
Note The query information is defined to be in the namespace fmq="http://www.filemaker.com/xml/query". Make
sure you include a declaration of the
fmq namespace in the <xsl:stylesheet> element at the start of your XSLT
stylesheet. See
“About namespaces and prefixes for FileMaker XSLT stylesheets” on page 50.
For example, suppose you want to access the query commands and query parameters in this request:
http://192.168.123.101/fmi/xsl/my_stylesheet.xsl?-db=products&-lay=sales&-grammar=fmresultset&-token.1=abc123
&-findall
If you include the <xsl:param name="request-query" /> statement before the template section, the Web Publishing
Engine will store this XML document fragment in that parameter:
<query action="my_stylesheet.xsl" xmlns="http://www.filemaker.com/xml/query">
<parameter name="-db">products</parameter>
<parameter name="-lay">sales</parameter>
<parameter name="-grammar">fmresultset</parameter>
<parameter name="-token.1">abc123</parameter>
<parameter name="-findall"></parameter>
</query>
You can then use the request-query parameter to access the value of a token that was passed in a URL by using
an XPath expression. For example:
$request-query/fmq:query/fmq:parameter[@name = '-token.1']