Show TOC Start of Content Area

Function documentation Output Properties Locate the document in its SAP Library structure

Use

The output properties can be set on the transformer to change indent, XML-declaration, type (XML, HTML, text), and so on. They can be applied to a transformation by using the xsl:output node in the stylesheet.

Features

These are predefined strings in the class javax.xml.transform.OutputKeys, which you may set to the transformer using transformer.setOutputProperty(String name, String value), on an instance of the transformer.

·        OutputKeys.VERSION – controls the version of the result document

·        OutputKeys.METHOD – can be XML, HTML, text or a namespace-qualified name.

·        OutputKeys.ENCODING – sets the encoding of the result. It is useful if you want to transform one source document from UTF-8 to ISO-8859-1, or any other encoding.

·        OutputKeys.DOCTYPE_PUBLIC and OutputKeys.DOCTYPE_SYSTEM – adds a <!DOCTYPE (root-tag) SYSTEM (System_key) (Public_key)>to the result.

·        OutputKeys.INDENT – can be yes or no. Enables you to control if the result has to be indented. In this way, you may add an indent to an XML file by transforming it from StreamSource to StreamResult, and setting the OutputProperty to yes.

 

End of Content Area