public final class XmlUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Document |
bytesToXml(byte[] bytes,
URL schemaURL)
Converts a XML bytes to a XML document validating with a schema.
|
static Document |
getDocument()
Create a new instance of a DOM Document object usied to build a DOM
trees.
|
static Transformer |
getTransformer()
Create a new Transformer object that performs a copy of the source to the
result.
|
static Document |
stringToXml(String xmlString,
InputStream schemaSource)
Converts a XML string to a XML document validating with a schema.
|
public static Document getDocument()
public static Transformer getTransformer()
public static Document bytesToXml(byte[] bytes, URL schemaURL) throws ParserConfigurationException, SAXException, IOException
bytes
- the array of bytes to be converted to an XML document.schemaURL
- the URL of the schema of the XML document.bytes
.NullPointerException
- if an argument is null
.ParserConfigurationException
- if a configuration error occurs.SAXException
- if a XML parse error occurs.IOException
- if an I/O error occurs.public static Document stringToXml(String xmlString, InputStream schemaSource) throws SAXException, IOException, ParserConfigurationException
xmlString
- a string with a XML representation of the document.schemaSource
- the input stream of a XML schema (can be null).xmlString
.ParserConfigurationException
- if a configuration error occurs.SAXException
- if a XML parse error occurs.IOException
- if an I/O error occurs.Copyright © OBCOM INGENIERIA S.A. (Chile). All Rights Reserved.