public class XmlHelper extends Object
| Constructor and Description |
|---|
XmlHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
applyXslt(File inputFile,
String stylesheet,
File outputFile)
Transform a file using the given xsl stylesheet.
|
protected static void |
applyXslt(Source src,
String stylesheet,
File outputFile)
Apply an xsl stylesheet to a java.xml.tranform.Source.
|
static DocumentBuilder |
getDocumentBuilder()
Returns a DocumentBuilder instance.
|
protected static XMLReader |
getReader()
Returns a XMLReader instance.
|
static String |
getTextContent(Node baseNode)
Get Node text content.
|
public static DocumentBuilder getDocumentBuilder() throws org.apache.maven.plugin.MojoExecutionException
FactoryConfigurationError - if the parser is not configuredParserConfigurationException - if the parser is not configuredorg.apache.maven.plugin.MojoExecutionExceptionprotected static XMLReader getReader() throws org.apache.maven.plugin.MojoExecutionException
SAXException - for errors on building the sax parserParserConfigurationException - if a SAX parser is not configuredorg.apache.maven.plugin.MojoExecutionExceptionprotected static void applyXslt(Source src, String stylesheet, File outputFile) throws org.apache.maven.plugin.MojoExecutionException, TransformerException
src - Sourcestylesheet - xslt used for transformationoutputFile - output fileTransformerExceptionException - xml parsing/transforming exceptionsorg.apache.maven.plugin.MojoExecutionExceptionprotected static void applyXslt(File inputFile, String stylesheet, File outputFile) throws org.apache.maven.plugin.MojoExecutionException
inputFile - input filestylesheet - xslt used for transformationoutputFile - output fileException - xml parsing/transforming exceptionsorg.apache.maven.plugin.MojoExecutionExceptionpublic static String getTextContent(Node baseNode) throws DOMException
baseNode - The node.DOMException - Any DOM exceptions.Copyright © 2004-2012 Fabrizio Giustina. All Rights Reserved.