Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a list of the properties of Transformer.setOutputProperty?

Tags:

I would like to know where I can find the list of properties settable by the method Transformer.setOutputProperty(String name, String value).

like image 222
The Student Avatar asked Mar 29 '10 18:03

The Student


People also ask

What is Transformer in java?

The Transformer object is used to convert strings to and from object instances. This is used during the serialization and deserialization process to transform types from the Java class libraries, as well as other types which do not contain XML schema annotations.

What is Java StreamSource?

public class StreamSource extends Object implements Source. Acts as an holder for a transformation Source in the form of a stream of XML markup. Note: Due to their internal use of either a Reader or InputStream instance, StreamSource instances may only be used once.

What is StreamResult in Java?

public class StreamResult extends Object implements Result. Acts as an holder for a transformation result, which may be XML, plain Text, HTML, or some other form of markup.


2 Answers

Rather obscurely, they're documented in the Xalan proprietary javadoc:

This method is used to set or override the value of the effective xsl:output attribute values specified in the stylesheet.

The recognized standard output properties are:

* cdata-section-elements * doctype-system * doctype-public * indent * media-type * method * omit-xml-declaration * standalone * version  

For example:

tran.setOutputProperty("standalone", "yes"); 
like image 59
skaffman Avatar answered Nov 20 '22 04:11

skaffman


Also, check out the javax.xml.transform.OutputKeys class.

tran.setOutputProperty(OutputKeys.STANDALONE, "yes"); 
like image 32
Michael Avatar answered Nov 20 '22 02:11

Michael