public class Transformer
extends java.lang.Object
| Constructor and Description |
|---|
Transformer()
Transformer constructor without stylesheet.
|
Transformer(javax.xml.transform.Source source)
Constructs a transformer with a stylesheet in form of Source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enableOutputDocType(boolean enable)
Sets whether to output the doc type.
|
javax.xml.transform.ErrorListener |
getErrorListener()
Get the error event handler in effect for the transformation.
|
java.util.Properties |
getOutputProperties()
Get a copy of the output properties for the transformation.
|
java.lang.String |
getOutputProperty(java.lang.String name)
Get an output property that is in effect for the transformation.
|
javax.xml.transform.Transformer |
getTransformer()
Returns the JAXP transformer encapsulated by this object.
|
void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Set the error event listener in effect for the transformation.
|
void |
setOutputProperties(java.util.Properties props)
Set the output properties for the transformation.
|
void |
setOutputProperty(java.lang.String name,
java.lang.String value)
Set an output property that will be in effect for the transformation.
|
Document |
transform(Document doc)
Transforms an iDOM document and returns the transformed result as
another iDOM Document.
|
void |
transform(Document doc,
javax.xml.transform.Result result)
Transforms from an iDOM document to a result.
|
Document |
transform(Element elm)
Transforms an iDOM element and returns the transformed result as
another iDOM Document.
|
void |
transform(Element elm,
javax.xml.transform.Result result)
Transforms from an iDOM element to a result.
|
Document |
transform(javax.xml.transform.Source source)
Transforms a source and returns the transformed result as
an iDOM Document.
|
void |
transform(javax.xml.transform.Source source,
javax.xml.transform.Result result)
Transforms from a source to a result.
|
public Transformer()
throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationExceptionpublic Transformer(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
Examples:
See javax.xml.transform.stream.StreamSource and javax.xml.transform.dom.DOMSource
javax.xml.transform.TransformerConfigurationExceptionpublic final void enableOutputDocType(boolean enable)
Useful only if Document is used in transform(), e.g.,
transform(Document, Result).
If not, you have to set OutputKeys.DOCTYPE_SYSTEM and
OutputKeys.DOCTYPE_PUBLIC explicitly (thru getTransformer()).
public final javax.xml.transform.Transformer getTransformer()
Notice: OutputKeys.DOCTYPE_SYSTEM and OutputKeys.DOCTYPE_PUBLIC
are set automatically if outDocType is true when constructing
this object and Document is used to transform.
public final void transform(javax.xml.transform.Source source,
javax.xml.transform.Result result)
throws javax.xml.transform.TransformerException
source - the sourceresult - the resultjavax.xml.transform.TransformerExceptiontransform(Document, Result)public final void transform(Document doc, javax.xml.transform.Result result) throws javax.xml.transform.TransformerException
Examples:
transform(Source) and transform(Document).See javax.xml.transform.stream.StreamResult and javax.xml.transform.dom.DOMResult
doc - the source documentresult - the resultjavax.xml.transform.TransformerExceptiontransform(Source, Result),
transform(Document)public final void transform(Element elm, javax.xml.transform.Result result) throws javax.xml.transform.TransformerException
elm - the source elementresult - the resultjavax.xml.transform.TransformerExceptionpublic final Document transform(javax.xml.transform.Source source) throws javax.xml.transform.TransformerException
source - the sourcejavax.xml.transform.TransformerExceptionpublic final Document transform(Document doc) throws javax.xml.transform.TransformerException
doc - the source documentjavax.xml.transform.TransformerExceptionpublic final Document transform(Element elm) throws javax.xml.transform.TransformerException
elm - the source elementjavax.xml.transform.TransformerExceptionpublic final java.util.Properties getOutputProperties()
public final java.lang.String getOutputProperty(java.lang.String name)
public final void setOutputProperty(java.lang.String name,
java.lang.String value)
public final void setOutputProperties(java.util.Properties props)
public final javax.xml.transform.ErrorListener getErrorListener()
public final void setErrorListener(javax.xml.transform.ErrorListener listener)
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.