Package net.datenwerke.rs.utils.xml
Class XMLUtilsServiceImpl
java.lang.Object
net.datenwerke.rs.utils.xml.XMLUtilsServiceImpl
- All Implemented Interfaces:
XMLUtilsService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an empty JAXP XML document.getXMLNodeAsString(Node node) Transforms an XML node (from a JAXP XML document) into a formatted string.getXMLNodeAsString(Node node, boolean omitXMLDeclaration) Transforms an XML node (from a JAXP XML document) into a formatted string.getXPath(String xpath, NamespaceContext namespaceContext) readInputFileIntoJAXPDoc(File file) Reads a file into a JAXP XML document.Reads an InputStream into a JAXP XML document.readStringIntoJAXPDoc(String data) Reads a file into a JAXP XML document.readStringIntoJAXPDoc(String data, String encoding) Reads a file into a JAXP XML document.xsltTranform(Source xsltSource, Source xmlSource)
-
Constructor Details
-
XMLUtilsServiceImpl
public XMLUtilsServiceImpl(<any> disableValidation)
-
-
Method Details
-
readInputFileIntoJAXPDoc
public Document readInputFileIntoJAXPDoc(File file) throws ParserConfigurationException, SAXException, IOException Reads a file into a JAXP XML document.- Specified by:
readInputFileIntoJAXPDocin interfaceXMLUtilsService- Parameters:
file- The input file.- Returns:
- The JAXP XML document.
- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
readStringIntoJAXPDoc
public Document readStringIntoJAXPDoc(String data) throws ParserConfigurationException, SAXException, IOException Reads a file into a JAXP XML document.- Specified by:
readStringIntoJAXPDocin interfaceXMLUtilsService- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
readStringIntoJAXPDoc
public Document readStringIntoJAXPDoc(String data, String encoding) throws ParserConfigurationException, SAXException, IOException Reads a file into a JAXP XML document.- Specified by:
readStringIntoJAXPDocin interfaceXMLUtilsService- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
readInputStreamIntoJAXPDoc
public Document readInputStreamIntoJAXPDoc(InputStream in) throws ParserConfigurationException, SAXException, IOException Reads an InputStream into a JAXP XML document.- Specified by:
readInputStreamIntoJAXPDocin interfaceXMLUtilsService- Parameters:
in- The input stream.- Returns:
- The JAXP XML document.
- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
getNewEmptyJAXPDoc
Creates an empty JAXP XML document.- Specified by:
getNewEmptyJAXPDocin interfaceXMLUtilsService- Returns:
- An empty JAXP XML document.
-
getXMLNodeAsString
Description copied from interface:XMLUtilsServiceTransforms an XML node (from a JAXP XML document) into a formatted string.- Specified by:
getXMLNodeAsStringin interfaceXMLUtilsService- Parameters:
node- The node to transform.- Returns:
- A string representation of the node.
-
getXMLNodeAsString
Transforms an XML node (from a JAXP XML document) into a formatted string.- Specified by:
getXMLNodeAsStringin interfaceXMLUtilsService- Parameters:
node- The node to transform.- Returns:
- A string representation of the node.
-
xsltTranform
-
getXPath
- Specified by:
getXPathin interfaceXMLUtilsService- Throws:
XPathException
-
getXPath
public XPathExpression getXPath(String xpath, NamespaceContext namespaceContext) throws XPathException - Specified by:
getXPathin interfaceXMLUtilsService- Throws:
XPathException
-