I would like to know where I can find the list of properties settable by the method Transformer.setOutputProperty(String name, String value)
.
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.
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.
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.
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");
Also, check out the javax.xml.transform.OutputKeys
class.
tran.setOutputProperty(OutputKeys.STANDALONE, "yes");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With