| java.lang.Object org.apache.cxf.helpers.DOMUtils
DOMUtils | final public class DOMUtils (Code) | | Few simple utils to read DOM. This is originally from the Jakarta Commons
Modeler.
author: Costin Manolache |
Inner Class :public static class NullResolver implements EntityResolver | |
Method Summary | |
public static Document | createDocument() | public static DocumentBuilder | createDocumentBuilder() | public static String | createNamespace(Element el, String ns) | public static Node | findChildWithAtt(Node parent, String elemName, String attName, String attVal) Find the first direct child with a given attribute. | public static String | getAttribute(Node element, String attName) | public static Node | getChild(Node parent, String name) Get the first element child.
Parameters: parent - lookup direct childs Parameters: name - name of the element. | public static Node | getChild(Node parent, int type) | public static String | getChildContent(Node parent, String name) Get the first child's content ( ie it's included TEXT node ). | public static String | getContent(Node n) | public static Element | getFirstElement(Node parent) | public static String | getNamespace(Element el, String pre) | public static Node | getNext(Node current) | public static Node | getNext(Node current, String name, int type) | public static String | getPrefix(Element el, String ns) | public static String | getPrefixRecursive(Element el, String ns) | public static String | getRawContent(Node n) | public static String | getUniquePrefix(Element el, String ns) | public static Document | readXml(InputStream is) Read XML as DOM. | public static Document | readXml(StreamSource is) | public static void | removeAttribute(Node node, String attName) | public static void | setAttribute(Node node, String attName, String val) | public static void | setText(Node node, String val) | public static void | writeXml(Node n, OutputStream os) |
findChildWithAtt | public static Node findChildWithAtt(Node parent, String elemName, String attName, String attVal)(Code) | | Find the first direct child with a given attribute.
Parameters: parent - Parameters: elemName - name of the element, or null for any Parameters: attName - attribute we're looking for Parameters: attVal - attribute value or null if we just want any |
getChild | public static Node getChild(Node parent, String name)(Code) | | Get the first element child.
Parameters: parent - lookup direct childs Parameters: name - name of the element. If null return the first element. |
getChild | public static Node getChild(Node parent, int type)(Code) | | Get the first direct child with a given type
|
getChildContent | public static String getChildContent(Node parent, String name)(Code) | | Get the first child's content ( ie it's included TEXT node ).
|
getContent | public static String getContent(Node n)(Code) | | Get the trimed text content of a node or null if there is no text
|
getFirstElement | public static Element getFirstElement(Node parent)(Code) | | Get the first direct child with a given type
|
getNext | public static Node getNext(Node current)(Code) | | Get the next sibling with the same name and type
|
getNext | public static Node getNext(Node current, String name, int type)(Code) | | Return the next sibling with a given name and type
|
getRawContent | public static String getRawContent(Node n)(Code) | | Get the raw text content of a node or null if there is no text
|
removeAttribute | public static void removeAttribute(Node node, String attName)(Code) | | |
setText | public static void setText(Node node, String val)(Code) | | Set or replace the text value
|
|
|