Custom Web Publishing Guide

Table Of Contents
Developing FileMaker XSLT stylesheets 57
Loading additional documents
To load an additional XML document during the processing of an XSLT stylesheet, use the standard XSLT
document() function with a URI to the XML document. The document() function returns the requested XML as
a node-set that can be stored in an
<xsl:variable> element.
To load an XML document that contains data from a FileMaker database, use the document() function with
FileMaker query command and parameters. For example:
<xsl:variable name="other-data" select="document(concat($xml-base-uri,'/fmi/xml/FMPXMLLAYOUT.xml?-db=products
&-lay=sales&-view'))"/>
To load an additional password-protected XML document that requires the same user name and password that
was specified in the original request currently being processed, use the authenticated-xml-base-uri parameter.
This parameter specifies the same user name and password as part of the URI that is passed to the
document()
function.
For example:
<xsl:variable name="other-data" select="document(concat($authenticated-xml-base-uri,'/fmi/xml/FMPXMLLAYOUT.xml?
-db=products&-lay=sales&-view'))"/>
To load a password-protected XML document that requires a different user name and password than what was
specified in the parent request, then use the following syntax to specify the user name and password as part of
the URI that is passed to the
document() function:
http://username:password@hostname/path?querystring
To load an XML document that is not based on a FileMaker database, use the document() function without
FileMaker query commands or query parameters. For example:
<xsl:variable name="other-data" select="document('http://server.company.com/data.xml')" />
If you use the document() function with a relative URL, the Web Publishing Engine will attempt to load the
XML document from the local file system in the location relative to where the stylesheet is stored. For
example, suppose a stylesheet that is located inside the mystylesheets folder inside the xslt-template-files
folder contains the following
document() function with a relative URL:
<xsl:variable name="mydoc" select="document('mystylesheets/mydoc.xml')" />
The Web Publishing Engine will attempt to load mydoc.xml from the mystylesheets folder inside the xslt-
template-files folder in the local file system.
Note When you use the Web Publishing Engine’s base URI to load a document, the Web Publishing Engine
supports HTTP only. When you load a document from an external server, the Web Publishing Engine supports
both HTTP and HTTPS.
Using a database’s layout information in a stylesheet
You can incorporate a FileMaker database’s layout information in a stylesheet by using the
FMPXMLLAYOUT grammar to request the information and then loading it into a variable via the XSLT
document() function:
<xsl:variable name="layout" select="document(concat($xml-base-uri,'/fmi/xml/FMPXMLLAYOUT.xml?-view'))" />