public final class XmlUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
XMLNS_ATTRIBUTE_KEY |
static String |
XMLNS_URI |
Modifier and Type | Method and Description |
---|---|
static Document |
createDocumentCopy(Document original) |
static Element |
createElement(Document document,
String qname,
com.google.common.base.Optional<String> namespaceURI) |
static String |
createPrefixedValue(String prefix,
String value) |
static Element |
createTextElement(Document document,
String qname,
String content,
com.google.common.base.Optional<String> namespaceURI) |
static Element |
createTextElementWithNamespacedContent(Document document,
String qname,
String prefix,
String namespace,
String contentWithoutPrefix) |
static Element |
createTextElementWithNamespacedContent(Document document,
String qname,
String prefix,
String namespace,
String contentWithoutPrefix,
com.google.common.base.Optional<String> namespaceURI) |
static Object |
evaluateXPath(XPathExpression expr,
Object rootNode,
QName returnType) |
static Schema |
loadSchema(InputStream... fromStreams) |
static Document |
newDocument() |
static Document |
readXmlToDocument(InputStream xmlContent) |
static Document |
readXmlToDocument(String xmlContent) |
static Element |
readXmlToElement(File xmlFile) |
static Element |
readXmlToElement(InputStream xmlContent) |
static Element |
readXmlToElement(String xmlContent) |
static String |
toString(Document document) |
static String |
toString(Document doc,
boolean addXmlDeclaration) |
static String |
toString(Element xml) |
static String |
toString(Element xml,
boolean addXmlDeclaration) |
static String |
toString(XmlElement xmlElement) |
public static final String XMLNS_ATTRIBUTE_KEY
public static final String XMLNS_URI
public static Element readXmlToElement(String xmlContent) throws SAXException, IOException
SAXException
IOException
public static Element readXmlToElement(InputStream xmlContent) throws SAXException, IOException
SAXException
IOException
public static Element readXmlToElement(File xmlFile) throws SAXException, IOException
SAXException
IOException
public static Document readXmlToDocument(String xmlContent) throws SAXException, IOException
SAXException
IOException
public static Document readXmlToDocument(InputStream xmlContent) throws SAXException, IOException
SAXException
IOException
public static Document newDocument()
public static Element createElement(Document document, String qname, com.google.common.base.Optional<String> namespaceURI)
public static Element createTextElement(Document document, String qname, String content, com.google.common.base.Optional<String> namespaceURI)
public static Element createTextElementWithNamespacedContent(Document document, String qname, String prefix, String namespace, String contentWithoutPrefix)
public static Element createTextElementWithNamespacedContent(Document document, String qname, String prefix, String namespace, String contentWithoutPrefix, com.google.common.base.Optional<String> namespaceURI)
public static String toString(XmlElement xmlElement)
public static Schema loadSchema(InputStream... fromStreams)
public static Object evaluateXPath(XPathExpression expr, Object rootNode, QName returnType)
Copyright © 2020. All rights reserved.