public final class XMLUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Set<QName> |
convertStringsToQNames(List<String> expandedQNames) |
static QName |
convertStringToQName(String expandedQName) |
static QName |
convertStringToQName(String expandedQName,
String prefix) |
static Element |
createElementNS(Document root,
QName name) |
static Element |
createElementNS(Document root,
String namespaceURI,
String qualifiedName) |
static Element |
createElementNS(Node node,
QName name) |
static Text |
createTextNode(Document root,
String data) |
static Text |
createTextNode(Node node,
String data) |
static Element |
fetchElementByNameAttribute(Element parent,
String targetName,
String nameValue) |
static Node |
fromSource(Source src) |
static void |
generateXMLFile(Element element,
Writer writer) |
static Attr |
getAttribute(Element el,
String attrName) |
static InputStream |
getInputStream(Document doc) |
static QName |
getNamespace(Map<String,String> namespaces,
String str,
String defaultNamespace) |
static DocumentBuilder |
getParser() |
static QName |
getQName(String value,
Node node) |
static boolean |
hasAttribute(Element element,
String value) |
static Document |
newDocument() |
static Transformer |
newTransformer() |
static Transformer |
newTransformer(int indent) |
static Document |
parse(byte[] in) |
static Document |
parse(File is) |
static Document |
parse(InputSource is) |
static Document |
parse(InputStream in) |
static Document |
parse(String in) |
static void |
printAttributes(Element element) |
static void |
printDOM(Node node) |
static void |
printDOM(String words,
Node node) |
static void |
removeContents(Node parent) |
static void |
replaceAttribute(Element element,
String attr,
String value) |
static String |
toString(Node node) |
static String |
toString(Node node,
int indent) |
static String |
toString(Source source) |
static String |
toString(Source source,
Properties props) |
static void |
writeTo(Node node,
OutputStream os) |
static void |
writeTo(Node node,
OutputStream os,
int indent) |
static void |
writeTo(Node node,
Writer os) |
static void |
writeTo(Node node,
Writer os,
int indent) |
static void |
writeTo(Source src,
OutputStream os) |
static void |
writeTo(Source src,
OutputStream os,
int indent) |
static void |
writeTo(Source src,
OutputStream os,
int indent,
String charset,
String omitXmlDecl) |
static void |
writeTo(Source src,
Writer os) |
static void |
writeTo(Source src,
Writer os,
int indent) |
static void |
writeTo(Source src,
Writer os,
int indent,
String charset,
String omitXmlDecl) |
static String |
xmlEncode(String value) |
public static Transformer newTransformer() throws TransformerConfigurationException
public static Transformer newTransformer(int indent) throws TransformerConfigurationException
public static DocumentBuilder getParser() throws ParserConfigurationException
ParserConfigurationException
public static Document parse(InputSource is) throws ParserConfigurationException, SAXException, IOException
public static Document parse(File is) throws ParserConfigurationException, SAXException, IOException
public static Document parse(InputStream in) throws ParserConfigurationException, SAXException, IOException
public static Document parse(String in) throws ParserConfigurationException, SAXException, IOException
public static Document parse(byte[] in) throws ParserConfigurationException, SAXException, IOException
public static Document newDocument() throws ParserConfigurationException
ParserConfigurationException
public static void writeTo(Node node, OutputStream os)
public static void writeTo(Node node, OutputStream os, int indent)
public static void writeTo(Source src, OutputStream os)
public static void writeTo(Source src, OutputStream os, int indent)
public static void writeTo(Source src, OutputStream os, int indent, String charset, String omitXmlDecl)
public static void writeTo(Source src, Writer os, int indent, String charset, String omitXmlDecl)
public static String toString(Source source) throws TransformerException, IOException
TransformerException
IOException
public static String toString(Source source, Properties props) throws TransformerException, IOException
TransformerException
IOException
public static void printDOM(Node node)
public static void printAttributes(Element element)
public static QName getNamespace(Map<String,String> namespaces, String str, String defaultNamespace)
public static Element createElementNS(Document root, String namespaceURI, String qualifiedName)
public static void removeContents(Node parent)
public static InputStream getInputStream(Document doc) throws Exception
Exception
public static Element fetchElementByNameAttribute(Element parent, String targetName, String nameValue)
Copyright © 2018 JBoss by Red Hat. All rights reserved.