ClassName |
|
---|---|
Component |
|
The XMLTransform servlet bean enables you to transform XML documents using a template. The template can be either an XSLT template or a JSP. The document to be transformed is specified by the input
parameter. The template to apply is specified (in order of precedence) by:
Template input parameter of the XMLTransform servlet bean
Mapping specified in the
XMLTemplateMap
ComponentDefault template specified in the
XMLTemplateMap
ComponentXSL stylesheet directive embedded in the XML source document
Input Parameters
input
The XML document to be transformed. This can be either the URL for an XML document, DOM document object, or SAX InputSource
or a text InputStream
.
validate
Optional: Determines if the parser should validate this document against the DTD specified in the input
parameter. Options include:
true: Read the DTD, validate the document, and apply all information from the DTD.
false (default): Read the DTD, do not validate the document, but substitute default attributes, and apply other information from the DTD at the parser’s discretion (Apache Xerces supports this mode).
nodtd
: Do not read the DTD, validate the document, or apply any defaults or other information. Use this mode when you do not want the parser to try and resolve the DTD location, perhaps because the remote URL location is temporarily unreachable. Note that the resulting document might be incomplete, might have incorrect attribute values, and does not have substitution of external entities. (Apache Xerces supports this mode, but it might not be available for every parser).
Note that if the XML document does not have a DTD, you must omit this parameter.
template
Optional: Specifies the template to be used to transform the XML document. This can be either an XSLT template or a JSP. Both absolute paths and relative paths are accepted.
passParams
Optional: Specifies, when the template is an XSL stylesheet, a flag to control the passing of parameters from the request and servlet bean environment, to top-level <xsl:param>
elements in the XSL stylesheet.
Legal values are:
none
: no parameters are passed (default)query
: URL query parameters from aGET
requestpost
: form parameters from aPOST
requestlocal
: only parameters in this servlet bean scopeall
: parameters from all servlet bean and request scopes
If more than one parameter exists for a given name, only the first is passed. The order of parameter scopes is from local (within the XMLTransform servlet bean), up through other enclosing scopes, and eventually to the request query or post parameters.
documentParameterName
Optional: Specifies the name of the parameter to which the input DOM Document is bound when using a JSP template. The default value of this parameter is inputDocument
.
Output Parameters
documentOuputName
Optional: The parameter to bind to the DOM document that results from the transformation. The default name is document.
errors
Optional: The parameter to bind to an enumeration of Exceptions if failures occurred when transforming the XML document.
Open Parameters
unset
Optional: Specifies the open parameter to render if the input
parameter is not set.
output
Optional: Specifies the parameter used when the XML document is successfully transformed. If the output
open parameter is specified, the document is not automatically output in the JSP.
failure
Optional: Specifies the parameter used to format output when there is a failure to transform the XML document.