Methods Summary |
---|
public java.lang.String | getEncoding()
return transformer.getOutputProperty(OutputKeys.ENCODING);
|
public java.lang.String | getVersion()
return transformer.getOutputProperty(OutputKeys.VERSION);
|
public boolean | isFormattedOutput()
return transformer.getOutputProperty(OutputKeys.INDENT).equals(YES);
|
public boolean | isFragment()
return fragment;
|
public void | setEncoding(java.lang.String encoding)
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
|
public void | setFormattedOutput(boolean shouldFormat)
if (shouldFormat) {
transformer.setOutputProperty(OutputKeys.INDENT, YES);
} else {
transformer.setOutputProperty(OutputKeys.INDENT, NO);
}
|
public void | setFragment(boolean fragment)
this.fragment = fragment;
|
public void | setVersion(java.lang.String version)
transformer.setOutputProperty(OutputKeys.VERSION, version);
|
public void | transform(org.w3c.dom.Node sourceNode, javax.xml.transform.Result result)
DOMSource source = null;
if ((isFragment()) && (result instanceof SAXResult)) {
if (sourceNode instanceof Document) {
source = new DOMSource(((Document)sourceNode).getDocumentElement());
}
} else {
source = new DOMSource(sourceNode);
}
transform(source, result);
|
public void | transform(org.w3c.dom.Node sourceNode, java.io.Writer resultWriter)
DOMSource source = new DOMSource(sourceNode);
StreamResult result = new StreamResult(resultWriter);
if (isFragment()) {
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
transform(source, result);
|
public void | transform(javax.xml.transform.Source source, javax.xml.transform.Result result)
try {
if ((result instanceof StreamResult) && (isFragment())) {
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
transformer.transform(source, result);
} catch (TransformerException e) {
throw XMLPlatformException.xmlPlatformTransformException(e);
}
|
public void | transform(org.w3c.dom.Document sourceDocument, org.w3c.dom.Node resultParentNode, java.net.URL stylesheet)
try {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
StreamSource stylesheetSource = new StreamSource(stylesheet.openStream());
Transformer transformer = transformerFactory.newTransformer(stylesheetSource);
DOMSource source = new DOMSource(sourceDocument);
DOMResult result = new DOMResult(resultParentNode);
transformer.transform(source, result);
} catch (Exception e) {
throw XMLPlatformException.xmlPlatformTransformException(e);
}
|
public void | transform(org.w3c.dom.Node sourceNode, java.io.OutputStream resultOutputStream)
DOMSource source = new DOMSource(sourceNode);
StreamResult result = new StreamResult(resultOutputStream);
if (isFragment()) {
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
transform(source, result);
|
public void | transform(org.w3c.dom.Node sourceNode, org.xml.sax.ContentHandler resultContentHandler)
DOMSource source = new DOMSource(sourceNode);
SAXResult result = new SAXResult(resultContentHandler);
transform(source, result);
|