public abstract class XmlUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlUtil.NamespaceValue |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areNodeEquals(Node n1,
Node n2)
Test the equality of two nodes following same conditions that org.w3c.dom.Node.isEqualNode(Node n) except for prefix.
|
static String |
attribute(Element element,
String attributeName)
the attribute value or null if the attribute is not present
|
static XmlUtil.NamespaceValue |
attributeNamespaceValue(Element element,
String attributeName) |
static QName |
attributeQName(Element element,
String attributeName) |
static List<Attr> |
attributes(Element element) |
static Document |
copyDocument(Document src) |
static Element |
element(Element element) |
static Element |
element(Element element,
String tagName) |
static Element |
element(Element element,
String ns,
String localName) |
static List<Element> |
elements(Element element) |
static List<Element> |
elements(Element element,
Set<String> allowedTagNames) |
static List<Element> |
elements(Element element,
String tagName) |
static List<Element> |
elements(Element father,
String ns,
String localName) |
static List<Element> |
elementsQName(Element element,
Set<QName> allowedTagNames) |
static String |
errorMessageAttribute(Element element,
String attributeName,
String attributeValue,
String message) |
static String |
getContentText(Element element) |
static Document |
getDocumentFromFile(File xmlFile) |
static Document |
getDocumentFromInputStream(InputStream is) |
static Document |
getDocumentFromReader(Reader r) |
static Document |
getDocumentFromString(String s) |
static Document |
getDocumentFromString(String s,
boolean createProxy) |
static Document |
getDocumentFromURL(URL xmlUrl) |
static Element |
getDocumentWithOneElement(QName elementQName) |
static String |
getNamespaceURI(Node n,
String prefix) |
static Document |
getNewDocument() |
static ByteArrayOutputStream |
getNodeAsBAOS(Node n) |
static QName |
getQNameFromString(Element element,
String qnameAsString) |
static String |
getTagLocalName(Element element) |
static TransformerFactory |
getTransformerFactory() |
static boolean |
isTextOnly(Element element) |
static Boolean |
parseBooleanValue(String valueText) |
static List<String> |
parseCommaSeparatedList(String commaSeparatedListText)
parses comma or space separated list.
|
static List<String> |
parseList(Element element,
String singularTagName) |
static String |
toString(Node node) |
static void |
writeXmlFile(Document doc,
File file)
This method writes a DOM document to a file.
|
public static List<Element> elementsQName(Element element, Set<QName> allowedTagNames)
public static boolean isTextOnly(Element element)
public static String attribute(Element element, String attributeName)
public static String errorMessageAttribute(Element element, String attributeName, String attributeValue, String message)
public static List<String> parseCommaSeparatedList(String commaSeparatedListText)
public static XmlUtil.NamespaceValue attributeNamespaceValue(Element element, String attributeName)
public static TransformerFactory getTransformerFactory()
public static Document getNewDocument()
public static void writeXmlFile(Document doc, File file)
doc - - doc to writefile - - dest file;public static ByteArrayOutputStream getNodeAsBAOS(Node n)
public static Document getDocumentFromInputStream(InputStream is)
public static boolean areNodeEquals(Node n1, Node n2)
n1 - First noden2 - Second nodeCopyright © 2012 OW2 Consortium. All Rights Reserved.