public class TransformerUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
OUTPUT_KEY_INDENT_AMOUT |
| Constructor and Description |
|---|
TransformerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Transformer |
newTransformer(Source source,
boolean omitXMLDeclaration,
int indentAmount,
String encoding)
Creates Transformer
|
static TransformerHandler |
newTransformerHandler(Source source,
boolean omitXMLDeclaration,
int indentAmount,
String encoding)
Creates TransformerHandler
|
static Transformer |
setOutputProperties(Transformer transformer,
boolean omitXMLDeclaration,
int indentAmount,
String encoding)
to set various output properties on given transformer.
|
public static final String OUTPUT_KEY_INDENT_AMOUT
public static Transformer setOutputProperties(Transformer transformer, boolean omitXMLDeclaration, int indentAmount, String encoding)
transformer - transformer on which properties are setomitXMLDeclaration - omit xml declaration or notindentAmount - the number fo spaces used for indentation.
use <=0, in case you dont want indentationencoding - required encoding. use null to don't set any encodingpublic static Transformer newTransformer(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding) throws TransformerConfigurationException
source - source of xsl document, use null for identity transformeromitXMLDeclaration - omit xml declaration or notindentAmount - the number fo spaces used for indentation.
use <=0, in case you dont want indentationencoding - required encoding. use null to don't set any encodingTransformerConfigurationExceptionpublic static TransformerHandler newTransformerHandler(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding) throws TransformerConfigurationException
source - source of xsl document, use null for identity transformeromitXMLDeclaration - omit xml declaration or notindentAmount - the number fo spaces used for indentation.
use <=0, in case you dont want indentationencoding - required encoding. use null to don't set any encodingTransformerConfigurationExceptionCopyright © 2019. All rights reserved.