Name:
XSLT
Description:
The XSLT handler provides XSLT transformations based on libxml2
and libxslt. Further information about these libraries is available
at http://xmlsoft.org. The input
may be either an XML, HTML or Docbook SGML document. An XSL stylsesheet
is applied to the paresd XML document and the result is sent back to
the client. The Content-Type for the output is automatic detected, if
possible. Otherwise the default Content-Type of the server is used.
POST requests are also supported.
Options:
Option | Default | Values | Short Description | Example(s) |
---|---|---|---|---|
DefaultStylesheet | - | <path name or URL> | A valid path name or URL to be used to load the XSLT stylesheet | DefaultStylesheet "./Default.xsl" |
DefaultContentType | - | <a mime type string> | A valid mime type to overwrite XSLT engine selection | DefaultContentType "application/rtf" |
MaxDepth | 500 | <a number> | The maximum depth of template stack | Example |
Variable | - | <a Pi3Expression> | A variable definition | Variable "GATEWAY_INTERFACE=CGI/1.1" |
ExtraHeaders | Yes | Yes|No | Indicates if extra headers are considered | ExtraHeaders Yes |
ExtraHeadersPrefix | - | <a string> | Used as prefix of each extra header | ExtraHeadersPrefix "HTTP_" |
ExtraHeadersIgnore | - | <Space delimited strings> | List of unconsidered extra headers | ExtraHeadersIgnore "Content-Type Content-Length" |
Options | - | Options flags as described below | Options which effect behaviour | Options "NoNetEntities | Verbose" |
Option | Meaning |
---|---|
SkipDtdLoading | Skip loading the document's DTD. |
Validate | Validate the document against it's DTD. |
NoNetEntities | Do not use the Internet to fetch DTD's or entities. |
WarnNetEntities | Output notification when DTD's or entities are fetched over the Internet. Not implemented yet. |
Verbose | Output each step taken by XSLT in processing the stylesheet and the document in the server debug log. Debug logging must be enabled in addition. |
XInclude | Process the input document using the Xinclude specification. More details on this can be found in the Xinclude specification: http://www.w3.org/TR/xinclude/ |
SgmlCatalogs | Use catalogs to resolve the location of external entities. This speeds DTD resolution. By having a catalog file point to a local version of the DTD, XSLT does not have to use the Internet to fetch the DTD. XSLT uses the catalog identified by the environmental variable SGML_CATALOG_FILES. |
Html | The input document is an HTML file. |
Docbook | The input document is DocBook SGML. This is not to be used for DocBook XML documents. |
Timing | Display the time used for parsing the stylesheet, parsing the document and applying the stylesheet and saving the result. Displayed in milliseconds. Not implemented yet. |
Profile | Output profiling information detailing the amount of time spent in each part of the stylesheet. This is useful in optimizing stylesheet performance. Not implemented yet. |
Debug | Output an XML tree of the transformed document for debugging purposes on STDOUT. |
Notes:
Some of the configuration options are not reentrant. None of the options are applied,
when the DefaultStylesheet is loaded at server startup. Embedded stylesheets work
only with enabled option "Validate", which is probably a bug in libxml2 (2.4.20).
The libxml 2 has been compiled _REENTRANT and with some minor changes. Thus other
binary distribution of libxml2 might not work with Pi3Web.
For POST requests the received form data must be of Content-Type "text/plain"
or "application/x-www-form-urlencoded". The received form is converted into a
generic XML format, which follows this simple DTD:
<!DOCTYPE form [ <!ELEMENT form (field+)> <!ELEMENT field #PCDATA> <!ATTLIST field name NMTOKEN #REQUIRED> ] >
Phase:
HANDLE
Returns:
PIAPI_COMPLETED, PIAPI_ERROR, or INT_REDIRECT accordingly
to the status returned by the handler.
Example:
<Object> Name XSLT Class XSLTClass </Object> <Object> ... Handle Condition="&cmp(&dblookup(response,string,ObjectMap,XSLT),XSLT)" \ XSLT ... </Object>