public class XMLUtil extends Object
| Constructor and Description |
|---|
XMLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Document |
loadXML(String filename)
Loads a W3C XML document from a file.
|
static Document |
transformDocument(Document xmlDocument,
Map<String,String> parameters,
String xsltFilename)
Applies a stylesheet (that receives parameters) to a given xml document.
|
static Document |
transformDocument(Document xmlDocument,
String xsltFilename)
Applies a stylesheet to a given xml document.
|
static String |
transformDocumentAsString(Document xmlDocument,
Map<String,String> parameters,
String xsltFilename)
Applies a stylesheet (that receives parameters) to a given xml document.
|
static String |
transformDocumentAsString(Document xmlDocument,
String xsltFilename)
Applies a stylesheet to a given xml document.
|
public static Document loadXML(String filename) throws IOException, ParserConfigurationException, SAXException
filename - The name of the file to be loadedIOExceptionParserConfigurationExceptionSAXExceptionpublic static Document transformDocument(Document xmlDocument, String xsltFilename) throws Exception
xmlDocument - the xml document to be transformedxsltFilename - the filename of the stylesheetExceptionpublic static Document transformDocument(Document xmlDocument, Map<String,String> parameters, String xsltFilename) throws Exception
xmlDocument - the xml document to be transformedparameters - the hashtable with the parameters to be passed to the
stylesheetxsltFilename - the filename of the stylesheetExceptionpublic static String transformDocumentAsString(Document xmlDocument, Map<String,String> parameters, String xsltFilename) throws Exception
xmlDocument - the xml document to be transformedparameters - the hashtable with the parameters to be passed to the
stylesheetxsltFilename - the filename of the stylesheetExceptionpublic static String transformDocumentAsString(Document xmlDocument, String xsltFilename) throws Exception
xmlDocument - the xml document to be transformedxsltFilename - the filename of the stylesheetExceptionCopyright © 2016 DuraSpace. All Rights Reserved.