List of utility methods to do XML Transform
DOMResult | transform(SOAPPart part) transform Transformer trans = TransformerFactory.newInstance().newTransformer(); DOMResult rs = new DOMResult(); trans.transform(part.getContent(), rs); return rs; |
void | transform(Source source, Result res) transform TransformerFactory.newInstance().newTransformer().transform(source, res); |
void | transform(Source source, Result result) transform transform(source, result, false); |
String | transform(Source source, Source stylesheet, Map This method performs XSL Transformation. try { TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(stylesheet); if (outputProperties != null) { transformer.setOutputProperties(outputProperties); if (params != null) { transformer.clearParameters(); ... |
Document | transform(Source source, Templates cachedXSLT) Transforms the given XML input stream using the specified cached XSLT stylesheet. DocumentBuilder builder = DOC_FACT.newDocumentBuilder(); Document document = builder.newDocument(); Result result = new DOMResult(document); Transformer trans = cachedXSLT.newTransformer(); trans.transform(source, result); return document; |
void | transform(Source xmlSource, Result outputTarget) transform Transformer t = transformer(); try { t.transform(xmlSource, outputTarget); } finally { t.reset(); |
void | transform(Source xmlSource, Templates template, Result result, Map Transform the XML to result. Transformer transformer = template.newTransformer(); if (parameters != null) { for (String key : parameters.keySet()) { transformer.setParameter(key, parameters.get(key)); transformer.setOutputProperty(OutputKeys.INDENT, "no"); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); ... |
void | transform(Source xsl, Source xml, Result result) Perform an xsl transformation TransformerFactory factory = TransformerFactory.newInstance(); Templates template = factory.newTemplates(xsl); Transformer transformer = template.newTransformer(); transformer.transform(xml, result); |
void | transform(String xmlInputFile, String xsltInputFile, OutputStream outputStream) Transform. File xmlFile = new File(xmlInputFile); File xsltFile = new File(xsltInputFile); transform(xmlFile, xsltFile, outputStream); |
String | transform(String xmlInURI, String xslInURI) transform String retValue = null; try { TransformerFactory tFactory = TransformerFactory.newInstance(); Templates translet = tFactory.newTemplates(new StreamSource(xslInURI)); Transformer transformer = translet.newTransformer(); DocumentBuilderFactory docFact = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuild = docFact.newDocumentBuilder(); Document doc = docBuild.parse(xmlInURI); ... |