Table of Contents

Common Stylesheet Parameters
Request URL
Servlet Path
Servlet URL
Root URL
User-Agent Header Field
Referer Field
If-Modified-Since Header Field
Other HTTP Headers
Pass-Through Configuration Parameters
[ You are here: XTF -> Tag Reference -> Common Stylesheet Parameters ]

Common Stylesheet Parameters


This section summarizes the standard set of XSL parameters available to every stylesheet used by the crossQuery and dynaXML servlets. These include the original URL of the current request (in a few handy forms), the XTF base directory, and headers from the HTTP request.

Request URL

This field identifies the full URL passed to the XTF system for the current request. The request URL is always available to servlets (unlike many of the following parameters which are optional). It is accessed via the XSL parameter
<xsl:param name="http.URL"/>
This parameter contains a URL string of the form: http://yourserver/yourport/servlet/queryparms
where
yourserver is the name of your XTF server
yourport is the port through which XTF requests are routed (typically 8080)
servlet is the name of the servlet to which the request is being sent. Normally, this is either search (for crossQuery) or view (for dynaXML)
queryparms is the list of parameters that defines the actual request being sent to the servlet. All URL escape codes (such as %20 for space) will have been translated to normal characters, and UTF-8 octet sequences will have been decoded.

Servlet Path

This field identifies the filesystem path of the XTF instance in which the stylesheet is running. It is accessed via the XSL parameter
<xsl:param name="servlet.path"/>
Typically this value comes from the servlet container (e.g. Resin or Tomcat), but may be overridden by specifying a base-dir parameter in the servlet container configuration. As this varies by container, check the documentation for your servlet container if you wish to override this value.

Servlet URL

This field identifies the URL used to access the servlet. It is accessed via the XSL parameter
<xsl:param name="servlet.URL"/>
This parameter contains a URL string of the form: http://yourserver{:yourport}/xtf/servlet
where
yourserver is the name of your XTF server
yourport is the port through which XTF requests are routed (typically 8080)
servlet is the name of the servlet to which the request is being sent. Normally, this is either search (for crossQuery) or view (for dynaXML)
Note that the query string is not included in this parameter; if you need to access the query string, use the Request URL parameter above.

Root URL

This field identifies the URL of this particular instance in the servlet container. The value is useful for accessing icons and other non-servlet resources from the container. It is accessed via the XSL parameter
<xsl:param name="root.URL"/>
This parameter contains a URL string of the form: http://yourserver{:yourport}/xtf/
where
yourserver is the name of your XTF server
yourport is the port through which XTF requests are routed (typically 8080)

Note that the servlet name and query string are not included in this parameter; if you need to access these, use the Request URL parameter or the Servlet URL parameter, above.

User-Agent Header Field

This optional HTTP header field identifies the browser that issued the current request. It is accessed via the XSL parameter
<xsl:param name="http.user-agent"/>
This parameter contains a string that identifies the browser that made the current request. Most HTTP requests will provide this field. For example:
Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; empas)
Note that the contents of this field vary widely depending on which browser made the request, and a detailed description is beyond the scope of this document.

Referer Field

This optional HTTP header field identifies the web page from which the request URL was issued. It is accessed via the XSL parameter
<xsl:param name="http.referer">
This parameter holds a URL string identifying the web page that issued the request. Often the initial request to the servlet will supply this parameter; subsequent requests will not.

If-Modified-Since Header Field

This optional HTTP header field identifies the last time a particular request URL was issued by a browser. This field can be used by an XTF stylesheet to determine if a request needs to be processed because the XTF database has changed, or whether the requesting browser can use its previously cached results. This field is accessed via the XSL parameter
<xsl:param name="http.if-modified-since"/>
Most HTTP responses will not include this parameter, but if they do, the contents of this time string of the form:
weekday, dd-mmm-yy hh:mm:ss timezone
where
weekday is the day of the week the request was last issued
dd-mmm-yy is the day, three letter month abbreviation, and year the request was last issued
hh:mm:ss is the time the request was last issued, represented as a 24 hour GMT based time
timezone is the offset in hours of the timezone from which the request was last issued.

Other HTTP Headers

All HTTP header fields are made available to stylesheets in a similar fashion to the fields detailed above. In general they are accessed via XSL parameters like this:
<xsl:param name="http.field-name">
where field-name is the name of the HTTP header field. Note that most HTTP header fields will be absent most of the time.

Pass-Through Configuration Parameters

Any unrecognized tag present in the configuration file for a given tool (i.e. textIndexer.conf for the textIndexer, dynaXML.conf for the dynaXML, etc.) will be made available to stylesheets run by that tool. These can be accessed by declaring an XSLT parameter containing the element name and the attribute name:
<xsl:param name="ElementName.AttributeName/>
For a concrete example, see the Programming Guide.