Given an XML document and an XSLT or JSP template, transforms and outputs the XML document.

Class Name

atg.droplet.xml.XMLTransform

Component

/atg/dynamo/droplet/xml/XMLTransform

Required Input Parameters

None

Optional Input Parameters

input

The XML document to transform, either the URL for an XML document, DOM document object, or SAX InputSource or a text InputStream. If omitted, the open parameter unset executes.

validate

Determines whether the parser should validate this document against the DTD specified in the input parameter. Options include:

If the XML document lacks a DTD, you must omit this parameter.

template

The template to use to transform the XML document. This can be either an XSLT template or a JSP. Both absolute paths and relative paths are accepted.

passParams

When the template is an XSL stylesheet, sets 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. Set to one of the following values:

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

The name of the parameter to which the input DOM Document is bound when using a JSP template. The default value is inputDocument.

Output Parameters

documentOuputName

Set to the DOM document that results from the transformation. The default is document.

errors

Set to an enumeration of Exceptions if failures occurred when transforming the XML document.

Open Parameters

unset

Rendered if the input parameter is omitted.

output

Rendered when the XML document is transformed. If the output open parameter is specified, the document is not automatically output in the JSP.

failure

Rendered when the XML document cannot be transformed.

Usage Notes

XMLTransform lets you transform XML documents with a template. The template can be either an XSLT template or a JSP. The document to transform is specified by the input parameter. The template to apply is determined in the following order of precedence:

Example

See Applying a Template to an XML Document

 
loading table of contents...