global.sandbox.xmlutilities
Class XMLTools

java.lang.Object
  extended by global.sandbox.xmlutilities.XMLTools

public abstract class XMLTools
extends java.lang.Object

Static version of the XMLUtilities class.

Version:
1.1
Author:
Petr Hadraba

Field Summary
private static XMLUtilities INTERNAL_XMLUTILITIES
          Use this constant, if you want to use internal XMLUtilities for the static methods
private static XMLUtilities xmlUtilities
          stores XMLUtilities object for the static usage
 
Constructor Summary
protected XMLTools()
          hidden constructor
 
Method Summary
static javax.xml.transform.Source documentToDOMSource(org.w3c.dom.Document source)
          converts Document to DOMSource object
static javax.xml.transform.Source documentToDOMSource(org.w3c.dom.Document source, java.lang.String systemId)
          converts Document to DOMSource object
static java.lang.String documentToString(org.w3c.dom.Document source)
          converst XML Document into String
static java.lang.String documentToString(org.w3c.dom.Document source, XMLUtilities xmlUtilities)
          converst XML Document into String
static org.w3c.dom.NodeList evaluateXPath(java.lang.String query, org.w3c.dom.Node context)
          evaluates specified XPath expression on specified context node
static org.w3c.dom.NodeList evaluateXPath(java.lang.String query, org.w3c.dom.Node context, javax.xml.namespace.NamespaceContext namespaces)
          evaluates specified XPath expression on specified context node
static org.w3c.dom.NodeList evaluateXPath(java.lang.String query, org.w3c.dom.Node context, javax.xml.namespace.NamespaceContext namespaces, XMLUtilities xmlUtilities)
          evaluates specified XPath expression on specified context node
static org.w3c.dom.NodeList evaluateXPath(java.lang.String query, org.w3c.dom.Node context, XMLUtilities xmlUtilities)
          evaluates specified XPath expression on specified context node
static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query, org.w3c.dom.Node context)
          evaluates specified XPath expression and returnes first Node if XPath has matches
static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query, org.w3c.dom.Node context, javax.xml.namespace.NamespaceContext namespaces)
          evaluates specified XPath expression and returnes first Node if XPath has matches
static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query, org.w3c.dom.Node context, javax.xml.namespace.NamespaceContext namespaces, XMLUtilities xmlUtilities)
          evaluates specified XPath expression and returnes first Node if XPath has matches
static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query, org.w3c.dom.Node context, XMLUtilities xmlUtilities)
          evaluates specified XPath expression and returnes first Node if XPath has matches
static javax.xml.parsers.DocumentBuilder getInternalDocumentBuilder()
          obtains DocumentBuilder object internaly used by the XMLUtilities static methods
static javax.xml.parsers.DocumentBuilderFactory getInternalDocumentBuilderFactory()
          obtains DocumentBuilderFactory object internaly used by the XMLUtilities static methods
static javax.xml.namespace.NamespaceContext getInternalNamespaceContext()
          obtains NamespaceContext object internaly used by the XMLUtilities static methods
static javax.xml.validation.SchemaFactory getInternalSchemaFactory()
          obtains SchemaFactory object internaly used by the XMLUtilities static methods
static javax.xml.transform.Transformer getInternalTransformer()
          obtains Transformer object internaly used by the XMLUtilities static methods
static javax.xml.transform.TransformerFactory getInternalTransformerFactory()
          obtains TransformerFactory object internaly used by the XMLUtilities static methods
static javax.xml.xpath.XPath getInternalXPath()
          obtains XPath object internaly used by the XMLUtilities static methods
static javax.xml.xpath.XPathFactory getInternalXPathFactory()
          obtains XPathFactory object internaly used by the XMLUtilities static methods
private static void initializeXMLUtilities()
          initializes XMLUtilities static member for the static usage
static void initializeXMLUtilities(XMLUtilities xmlUtilities)
          initializes XMLUtilities static member for the static usage using specified XMLUtilities
static org.w3c.dom.Document loadDocumentFromFile(java.io.File file)
          loads XML from file specified with the File object
static org.w3c.dom.Document loadDocumentFromFile(java.io.File file, javax.xml.parsers.DocumentBuilder documentBuilder)
          loads XML from file specified with the file object
static org.w3c.dom.Document loadDocumentFromFile(java.io.File file, javax.xml.parsers.DocumentBuilder documentBuilder, XMLUtilities xmlUtilities)
          loads XML from file specified with the file object
static org.w3c.dom.Document loadDocumentFromFile(java.io.File file, XMLUtilities xmlUtilities)
          loads XML from file specified with the File object
static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName)
          loads XML from file specified with file name
static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName, javax.xml.parsers.DocumentBuilder documentBuilder)
          loads XML from file specified with file name
static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName, javax.xml.parsers.DocumentBuilder documentBuilder, XMLUtilities xmlUtilities)
          loads XML from file specified with file name
static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName, XMLUtilities xmlUtilities)
          loads XML from file specified with file name
static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is)
          loads XML from specified stream
static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is, javax.xml.parsers.DocumentBuilder documentBuilder)
          loads XML from specified input stream
static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is, javax.xml.parsers.DocumentBuilder documentBuilder, XMLUtilities xmlUtilities)
          loads XML from specified input stream
static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is, XMLUtilities xmlUtilities)
          loads XML from specified stream
static org.w3c.dom.Document loadDocumentFromString(java.lang.String source)
          loads document from String into the Document
static org.w3c.dom.Document loadDocumentFromString(java.lang.String source, javax.xml.parsers.DocumentBuilder documentBuilder)
          loads document from String into the Document
static org.w3c.dom.Document loadDocumentFromString(java.lang.String source, javax.xml.parsers.DocumentBuilder documentBuilder, XMLUtilities xmlUtilities)
          loads document from String into the Document
static org.w3c.dom.Document loadDocumentFromString(java.lang.String source, XMLUtilities xmlUtilities)
          loads document from String into the Document
static javax.xml.transform.Source loadSourceFromString(java.lang.String source)
          loads XML from String
static javax.xml.transform.Source loadSourceFromString(java.lang.String source, java.lang.String systemId)
          loads XML from String
static java.lang.String sourceToString(javax.xml.transform.Source source)
          converts XML Source into String
static java.lang.String sourceToString(javax.xml.transform.Source source, XMLUtilities xmlUtilities)
          converts XML Source into String
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document)
          transforms specified XML using specified XSLT template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters)
          transforms specified XML using specified XSLT template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters, XMLUtilities xmlUtilities)
          transforms specified XML using specified XSLT template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, XMLUtilities xmlUtilities)
          transforms specified XML using specified XSLT template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document)
          transforms specified XML document using XSLT (compiled) template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters)
          transforms specified XML document using XSLT (compiled) template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters, XMLUtilities xmlUtilities)
          transforms specified XML document using XSLT (compiled) template
static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, XMLUtilities xmlUtilities)
          transforms specified XML document using XSLT (compiled) template
static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document)
          transformes specified XML document using specified XSLT template
static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters)
          transformes specified XML document using specified XSLT template
static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters, XMLUtilities xmlUtilities)
          transformes specified XML document using specified XSLT template
static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate, javax.xml.transform.Source document, XMLUtilities xmlUtilities)
          transformes specified XML document using specified XSLT template
static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document)
          transforms specified XML document using XSLT (compiled) template
static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters)
          transforms specified XML document using XSLT (compiled) template
static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, java.util.Map<java.lang.String,java.lang.Object> parameters, XMLUtilities xmlUtilities)
          transforms specified XML document using XSLT (compiled) template
static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate, javax.xml.transform.Source document, XMLUtilities xmlUtilities)
          transforms specified XML document using XSLT (compiled) template
static java.lang.String validateXmlUsingSchema(javax.xml.transform.Source xmlDocument, javax.xml.transform.Source xmlSchema)
          validates specified XML with the specified XMLScheme
static java.lang.String validateXmlUsingSchema(javax.xml.transform.Source xmlDocument, javax.xml.transform.Source xmlSchema, XMLUtilities xmlUtilities)
          validates specified XML with the specified XMLScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL_XMLUTILITIES

private static final XMLUtilities INTERNAL_XMLUTILITIES
Use this constant, if you want to use internal XMLUtilities for the static methods


xmlUtilities

private static XMLUtilities xmlUtilities
stores XMLUtilities object for the static usage

Constructor Detail

XMLTools

protected XMLTools()
hidden constructor

Method Detail

documentToDOMSource

public static javax.xml.transform.Source documentToDOMSource(org.w3c.dom.Document source)
converts Document to DOMSource object

Parameters:
source - Document XML representation
Returns:
converted XML source

documentToDOMSource

public static javax.xml.transform.Source documentToDOMSource(org.w3c.dom.Document source,
                                                             java.lang.String systemId)
converts Document to DOMSource object

Parameters:
source - Document XML representation
systemId - system ID
Returns:
converted XML source

documentToString

public static java.lang.String documentToString(org.w3c.dom.Document source,
                                                XMLUtilities xmlUtilities)
                                         throws javax.xml.transform.TransformerException,
                                                java.io.IOException,
                                                javax.xml.xpath.XPathFactoryConfigurationException,
                                                javax.xml.parsers.ParserConfigurationException
converst XML Document into String

Parameters:
source - Document to convert
xmlUtilities - custom XMLUtilities; can be null
Returns:
XML in the String
Throws:
javax.xml.transform.TransformerException
java.io.IOException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

documentToString

public static java.lang.String documentToString(org.w3c.dom.Document source)
                                         throws javax.xml.transform.TransformerException,
                                                java.io.IOException,
                                                javax.xml.xpath.XPathFactoryConfigurationException,
                                                javax.xml.parsers.ParserConfigurationException
converst XML Document into String

Parameters:
source - Document to convert
Returns:
XML in the String
Throws:
javax.xml.transform.TransformerException
java.io.IOException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

evaluateXPath

public static org.w3c.dom.NodeList evaluateXPath(java.lang.String query,
                                                 org.w3c.dom.Node context,
                                                 javax.xml.namespace.NamespaceContext namespaces,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathExpressionException,
                                                 javax.xml.transform.TransformerConfigurationException,
                                                 javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression on specified context node

Parameters:
query - XPath expression
context - context node
namespaces - namespace context
xmlUtilities - custom XMLUtilities; can be null
Returns:
NodeList or null if no matches
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

evaluateXPath

public static org.w3c.dom.NodeList evaluateXPath(java.lang.String query,
                                                 org.w3c.dom.Node context,
                                                 javax.xml.namespace.NamespaceContext namespaces)
                                          throws javax.xml.xpath.XPathExpressionException,
                                                 javax.xml.transform.TransformerConfigurationException,
                                                 javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression on specified context node

Parameters:
query - XPath expression
context - context node
namespaces - namespace context
Returns:
NodeList or null if no matches
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

evaluateXPath

public static org.w3c.dom.NodeList evaluateXPath(java.lang.String query,
                                                 org.w3c.dom.Node context,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathExpressionException,
                                                 javax.xml.transform.TransformerConfigurationException,
                                                 javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression on specified context node

Parameters:
query - XPath expression
context - context node
xmlUtilities - custom XMLUtilities; can be null
Returns:
NodeList or null if no matches
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

evaluateXPath

public static org.w3c.dom.NodeList evaluateXPath(java.lang.String query,
                                                 org.w3c.dom.Node context)
                                          throws javax.xml.xpath.XPathExpressionException,
                                                 javax.xml.transform.TransformerConfigurationException,
                                                 javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression on specified context node

Parameters:
query - XPath expression
context - context node
Returns:
NodeList or null if no matches
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

getFirstNodeForXPath

public static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query,
                                                    org.w3c.dom.Node context,
                                                    XMLUtilities xmlUtilities)
                                             throws javax.xml.xpath.XPathExpressionException,
                                                    javax.xml.transform.TransformerConfigurationException,
                                                    javax.xml.xpath.XPathFactoryConfigurationException,
                                                    javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression and returnes first Node if XPath has matches

Parameters:
query - XPath expression
context - context node
xmlUtilities - xustom XMLUtilities; can be null
Returns:
first node or null
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

getFirstNodeForXPath

public static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query,
                                                    org.w3c.dom.Node context)
                                             throws javax.xml.xpath.XPathExpressionException,
                                                    javax.xml.transform.TransformerConfigurationException,
                                                    javax.xml.xpath.XPathFactoryConfigurationException,
                                                    javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression and returnes first Node if XPath has matches

Parameters:
query - XPath expression
context - context node
Returns:
first node or null
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

getFirstNodeForXPath

public static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query,
                                                    org.w3c.dom.Node context,
                                                    javax.xml.namespace.NamespaceContext namespaces,
                                                    XMLUtilities xmlUtilities)
                                             throws javax.xml.xpath.XPathExpressionException,
                                                    javax.xml.transform.TransformerConfigurationException,
                                                    javax.xml.xpath.XPathFactoryConfigurationException,
                                                    javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression and returnes first Node if XPath has matches

Parameters:
query - XPath expression
context - context node
namespaces - namespace context
xmlUtilities - xustom XMLUtilities; can be null
Returns:
first node or null
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

getFirstNodeForXPath

public static org.w3c.dom.Node getFirstNodeForXPath(java.lang.String query,
                                                    org.w3c.dom.Node context,
                                                    javax.xml.namespace.NamespaceContext namespaces)
                                             throws javax.xml.xpath.XPathExpressionException,
                                                    javax.xml.transform.TransformerConfigurationException,
                                                    javax.xml.xpath.XPathFactoryConfigurationException,
                                                    javax.xml.parsers.ParserConfigurationException
evaluates specified XPath expression and returnes first Node if XPath has matches

Parameters:
query - XPath expression
context - context node
namespaces - namespace context
Returns:
first node or null
Throws:
javax.xml.xpath.XPathExpressionException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

initializeXMLUtilities

private static void initializeXMLUtilities()
                                    throws javax.xml.transform.TransformerConfigurationException,
                                           javax.xml.xpath.XPathFactoryConfigurationException,
                                           javax.xml.parsers.ParserConfigurationException
initializes XMLUtilities static member for the static usage

Throws:
javax.xml.parsers.ParserConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.transform.TransformerConfigurationException

initializeXMLUtilities

public static void initializeXMLUtilities(XMLUtilities xmlUtilities)
initializes XMLUtilities static member for the static usage using specified XMLUtilities

Parameters:
xmlUtilities - XMLUtilities to use

getInternalSchemaFactory

public static javax.xml.validation.SchemaFactory getInternalSchemaFactory()
obtains SchemaFactory object internaly used by the XMLUtilities static methods

Returns:
SchemaFactory object

getInternalDocumentBuilder

public static javax.xml.parsers.DocumentBuilder getInternalDocumentBuilder()
obtains DocumentBuilder object internaly used by the XMLUtilities static methods

Returns:
DocumentBuilder object

getInternalTransformerFactory

public static javax.xml.transform.TransformerFactory getInternalTransformerFactory()
obtains TransformerFactory object internaly used by the XMLUtilities static methods

Returns:
TransformerFactory object

getInternalTransformer

public static javax.xml.transform.Transformer getInternalTransformer()
obtains Transformer object internaly used by the XMLUtilities static methods

Returns:
Transformer object

getInternalXPathFactory

public static javax.xml.xpath.XPathFactory getInternalXPathFactory()
obtains XPathFactory object internaly used by the XMLUtilities static methods

Returns:
XPathFactory object

getInternalNamespaceContext

public static javax.xml.namespace.NamespaceContext getInternalNamespaceContext()
obtains NamespaceContext object internaly used by the XMLUtilities static methods

Returns:
NamespaceContext object

validateXmlUsingSchema

public static java.lang.String validateXmlUsingSchema(javax.xml.transform.Source xmlDocument,
                                                      javax.xml.transform.Source xmlSchema,
                                                      XMLUtilities xmlUtilities)
                                               throws javax.xml.transform.TransformerConfigurationException,
                                                      javax.xml.xpath.XPathFactoryConfigurationException,
                                                      javax.xml.parsers.ParserConfigurationException,
                                                      java.io.IOException
validates specified XML with the specified XMLScheme

Parameters:
xmlDocument - XML document to validate
xmlSchema - XMLSchema
xmlUtilities - specified XMLUtilities. if null, internal will be used
Returns:
null if successfull, string with error otherwise
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException

validateXmlUsingSchema

public static java.lang.String validateXmlUsingSchema(javax.xml.transform.Source xmlDocument,
                                                      javax.xml.transform.Source xmlSchema)
                                               throws javax.xml.transform.TransformerConfigurationException,
                                                      javax.xml.xpath.XPathFactoryConfigurationException,
                                                      javax.xml.parsers.ParserConfigurationException,
                                                      java.io.IOException
validates specified XML with the specified XMLScheme

Parameters:
xmlDocument - XML document to validate
xmlSchema - XMLSchema
Returns:
null if successfull, string with error otherwise
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName,
                                                        XMLUtilities xmlUtilities)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with file name

Parameters:
fileName - file to load
xmlUtilities - custom XMLUtilities object; can be null
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with file name

Parameters:
fileName - file to load
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName,
                                                        javax.xml.parsers.DocumentBuilder documentBuilder,
                                                        XMLUtilities xmlUtilities)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with file name

Parameters:
fileName - file to load
documentBuilder - custom DocumentBuilder
xmlUtilities - custom XMLUtilities; can be null
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.lang.String fileName,
                                                        javax.xml.parsers.DocumentBuilder documentBuilder)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with file name

Parameters:
fileName - file to load
documentBuilder - custom DocumentBuilder
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.io.File file,
                                                        XMLUtilities xmlUtilities)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with the File object

Parameters:
file - file to load
xmlUtilities - custom XMLUtilities; can be null
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.io.File file)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with the File object

Parameters:
file - file to load
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.io.File file,
                                                        javax.xml.parsers.DocumentBuilder documentBuilder,
                                                        XMLUtilities xmlUtilities)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with the file object

Parameters:
file - fileto load
documentBuilder - custom document builder
xmlUtilities - custom XMLUtilities; can be null
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromFile

public static org.w3c.dom.Document loadDocumentFromFile(java.io.File file,
                                                        javax.xml.parsers.DocumentBuilder documentBuilder)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        org.xml.sax.SAXException,
                                                        javax.xml.transform.TransformerConfigurationException,
                                                        javax.xml.xpath.XPathFactoryConfigurationException,
                                                        javax.xml.parsers.ParserConfigurationException
loads XML from file specified with the file object

Parameters:
file - fileto load
documentBuilder - custom document builder
Returns:
Document object
Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException

loadDocumentFromStream

public static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is,
                                                          XMLUtilities xmlUtilities)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          java.io.IOException,
                                                          org.xml.sax.SAXException
loads XML from specified stream

Parameters:
is - input stream
xmlUtilities - custom XMLUtilities (can be null)
Returns:
Document object
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

loadDocumentFromStream

public static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          java.io.IOException,
                                                          org.xml.sax.SAXException
loads XML from specified stream

Parameters:
is - input stream
Returns:
Document object
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

loadDocumentFromStream

public static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is,
                                                          javax.xml.parsers.DocumentBuilder documentBuilder,
                                                          XMLUtilities xmlUtilities)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          java.io.IOException,
                                                          org.xml.sax.SAXException
loads XML from specified input stream

Parameters:
is - input stream
documentBuilder - custom Document Builder
xmlUtilities - custom XMLUtilities (can be null)
Returns:
Document object
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

loadDocumentFromStream

public static org.w3c.dom.Document loadDocumentFromStream(java.io.InputStream is,
                                                          javax.xml.parsers.DocumentBuilder documentBuilder)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          java.io.IOException,
                                                          org.xml.sax.SAXException
loads XML from specified input stream

Parameters:
is - input stream
documentBuilder - custom Document Builder
Returns:
Document object
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

getInternalDocumentBuilderFactory

public static javax.xml.parsers.DocumentBuilderFactory getInternalDocumentBuilderFactory()
obtains DocumentBuilderFactory object internaly used by the XMLUtilities static methods

Returns:
DocumentBuilderFactory object

getInternalXPath

public static javax.xml.xpath.XPath getInternalXPath()
obtains XPath object internaly used by the XMLUtilities static methods

Returns:
XPath object

transformToString

public static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate,
                                                 javax.xml.transform.Source document)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transformes specified XML document using specified XSLT template

Parameters:
xsltTemplate - template to use
document - source XML document
Returns:
resulting document in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transformes specified XML document using specified XSLT template

Parameters:
xsltTemplate - XSLT template
document - source XML document
xmlUtilities - custom XMLUtilities
Returns:
resulting XML document in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 java.util.Map<java.lang.String,java.lang.Object> parameters)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transformes specified XML document using specified XSLT template

Parameters:
xsltTemplate - XSLT template to use
document - source XML document
parameters - parameters for the XSLT processor
Returns:
resulting XML file in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Source xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 java.util.Map<java.lang.String,java.lang.Object> parameters,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transformes specified XML document using specified XSLT template

Parameters:
xsltTemplate - XSLT template to use
document - source XML document
parameters - parameters for the XSLT processor
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML document in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 java.util.Map<java.lang.String,java.lang.Object> parameters,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
parameters - parameters for the transformation
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML document in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 java.util.Map<java.lang.String,java.lang.Object> parameters)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
parameters - parameters for the transformation
Returns:
resulting XML document in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate,
                                                 javax.xml.transform.Source document,
                                                 XMLUtilities xmlUtilities)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToString

public static java.lang.String transformToString(javax.xml.transform.Templates xsltTemplate,
                                                 javax.xml.transform.Source document)
                                          throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
Returns:
resulting XML in the String
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       java.util.Map<java.lang.String,java.lang.Object> parameters,
                                                       XMLUtilities xmlUtilities)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
parameters - parameters for the transformation
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       java.util.Map<java.lang.String,java.lang.Object> parameters)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
parameters - parameters for the transformation
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       XMLUtilities xmlUtilities)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Templates xsltTemplate,
                                                       javax.xml.transform.Source document)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML document using XSLT (compiled) template

Parameters:
xsltTemplate - template to use
document - XML document to transform
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

loadDocumentFromString

public static org.w3c.dom.Document loadDocumentFromString(java.lang.String source)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          org.xml.sax.SAXException,
                                                          java.io.IOException
loads document from String into the Document

Parameters:
source - source XML
Returns:
resulting XML
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

loadDocumentFromString

public static org.w3c.dom.Document loadDocumentFromString(java.lang.String source,
                                                          XMLUtilities xmlUtilities)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          org.xml.sax.SAXException,
                                                          java.io.IOException
loads document from String into the Document

Parameters:
source - source XML
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

loadDocumentFromString

public static org.w3c.dom.Document loadDocumentFromString(java.lang.String source,
                                                          javax.xml.parsers.DocumentBuilder documentBuilder)
                                                   throws org.xml.sax.SAXException,
                                                          java.io.IOException
loads document from String into the Document

Parameters:
source - source XML
documentBuilder - custom document builder
Returns:
resulting XML
Throws:
org.xml.sax.SAXException
java.io.IOException

loadDocumentFromString

public static org.w3c.dom.Document loadDocumentFromString(java.lang.String source,
                                                          javax.xml.parsers.DocumentBuilder documentBuilder,
                                                          XMLUtilities xmlUtilities)
                                                   throws javax.xml.transform.TransformerConfigurationException,
                                                          javax.xml.xpath.XPathFactoryConfigurationException,
                                                          javax.xml.parsers.ParserConfigurationException,
                                                          org.xml.sax.SAXException,
                                                          java.io.IOException
loads document from String into the Document

Parameters:
source - source XML
documentBuilder - cutom DocumentBuilder to use
xmlUtilities - custom XMLUtilities to use
Returns:
resulting XML
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

sourceToString

public static java.lang.String sourceToString(javax.xml.transform.Source source)
                                       throws javax.xml.transform.TransformerConfigurationException,
                                              javax.xml.xpath.XPathFactoryConfigurationException,
                                              javax.xml.parsers.ParserConfigurationException,
                                              java.io.IOException,
                                              javax.xml.transform.TransformerException
converts XML Source into String

Parameters:
source - source Document
Returns:
XML in the String
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
javax.xml.transform.TransformerException

sourceToString

public static java.lang.String sourceToString(javax.xml.transform.Source source,
                                              XMLUtilities xmlUtilities)
                                       throws javax.xml.transform.TransformerConfigurationException,
                                              javax.xml.xpath.XPathFactoryConfigurationException,
                                              javax.xml.parsers.ParserConfigurationException,
                                              java.io.IOException,
                                              javax.xml.transform.TransformerException
converts XML Source into String

Parameters:
source - source Document
xmlUtilities - XMLUtilities to use
Returns:
XML in the String
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       java.util.Map<java.lang.String,java.lang.Object> parameters,
                                                       XMLUtilities xmlUtilities)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML using specified XSLT template

Parameters:
xsltTemplate - XSLT template
document - source XML document
parameters - parameters for the template
xmlUtilities - XMLUtilities to use
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       java.util.Map<java.lang.String,java.lang.Object> parameters)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML using specified XSLT template

Parameters:
xsltTemplate - XSLT template
document - source XML document
parameters - parameters for the template
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate,
                                                       javax.xml.transform.Source document,
                                                       XMLUtilities xmlUtilities)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML using specified XSLT template

Parameters:
xsltTemplate - XSLT template
document - source XML document
xmlUtilities - XMLUtilities to use
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

transformToDocument

public static org.w3c.dom.Document transformToDocument(javax.xml.transform.Source xsltTemplate,
                                                       javax.xml.transform.Source document)
                                                throws javax.xml.xpath.XPathFactoryConfigurationException,
                                                       javax.xml.parsers.ParserConfigurationException,
                                                       org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.transform.TransformerException
transforms specified XML using specified XSLT template

Parameters:
xsltTemplate - XSLT template
document - source XML document
Returns:
resulting XML in the Document
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

loadSourceFromString

public static javax.xml.transform.Source loadSourceFromString(java.lang.String source)
loads XML from String

Parameters:
source - source string
Returns:
XML in the Source

loadSourceFromString

public static javax.xml.transform.Source loadSourceFromString(java.lang.String source,
                                                              java.lang.String systemId)
loads XML from String

Parameters:
source - source string
systemId - system ID
Returns:
XML in the Source