Custom Web Publishing Guide

Table Of Contents
Chapter 3
|
Accessing XML data with the Web Publishing Engine 39
6. Sort the resulting data, if a sort was specified.
7. Process the –lay.response query parameter to switch to a different layout, if this is specified.
8. Process the –script query parameter, if specified.
9. Generate the XML document.
If one of the above steps generates an error code, the request processing stops; any steps that follow are not
executed. However, any prior steps in the request are still executed.
For example, consider a request that deletes the current record, sorts the records, and then executes a script.
If the
–sortfield parameter specifies a non-existent field, the request deletes the current record and returns
error code 102 (“
Field is missing”), but does not execute the script.
Using server-side and client-side processing of stylesheets
The Web Publishing Engine supports server-side processing of an XSLT stylesheet, and also allows you to
use a query parameter that specifies client-side processing of a stylesheet.
It is important to understand the differences between the two ways to process stylesheets, and the security
implications of using client-side processing. Server-side processing is more secure than client-side
processing because server-side processing does not give web users access to the unfiltered XML data. With
server-side processing, the data is presented in a form that the data owner or the XSLT stylesheet author
decides is appropriate to present. Server-side processing hides the database names, field names, and other
implementation details from web users. Server-side processing can also be used to specify statically defined
query parameters, which prevent the use of unauthorized query commands and query parameters, such as
database names. See
chapter 4, “Introduction to Custom Web Publishing with XSLT” and chapter 5,
“Developing FileMaker XSLT stylesheets.
If your solution requires client-side stylesheet processing, you can have the Web Publishing Engine generate
an XML stylesheet processing instruction with each grammar by including the
–styletype and –stylehref
parameters in the FileMaker query string request. You can use cascading stylesheets (CSS) or XSLT
stylesheets for displaying your XML document.
1 The –styletype parameter is used for setting the value of the type attribute (type=text/css or type=text/xsl).
1 The –stylehref parameter is used for setting the value of the HREF attribute that specifies the location of
the stylesheet using an absolute path. For example:
href=/mystylesheet.css or href=/stylesheets/
mystylesheet.xsl
. The name of the stylesheet can be any name but it must contain an extension of either
.css or .xsl.
Here is an example of a FileMaker query string that generates client-side stylesheet processing:
http://localhost/fmi/xml/fmresultset.xml?–db=products–lay=sales&–findall&–styletype=text/xsl
&–stylehref=/mystylesheet.xsl
Note This “/” in “–stylehref=/document.xsl” in this example is used because the stylesheet is located in the
root folder of the web server software. Use a URL for the stylesheet that uses an absolute path to specify its
location on the web server. The stylesheet can also be located on another web server.