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 MojoExecutionException
MojoExecutionException
- in case of an XML-Parser-Errorprotected static XMLReader getReader() throws MojoExecutionException
MojoExecutionException
- in case of an SAX-Parser-Errorprotected static void applyXslt(Source src, String stylesheet, File outputFile) throws MojoExecutionException, TransformerException, IOException
src
- Sourcestylesheet
- xslt used for transformationoutputFile
- output fileMojoExecutionException
- xml parsing/transforming exceptionsTransformerException
- If an unrecoverable error occurs
during the course of the transformation.IOException
- if output directory could not createdprotected static void applyXslt(File inputFile, String stylesheet, File outputFile) throws MojoExecutionException
inputFile
- input filestylesheet
- xslt used for transformationoutputFile
- output fileMojoExecutionException
- xml parsing/transforming exceptionspublic static String getTextContent(Node baseNode) throws DOMException
baseNode
- The node.DOMException
- Any DOM exceptions.Copyright © 2004–2022 Web-Legacy. All rights reserved.