| java.lang.Object com.bostechcorp.cbesb.common.util.Dom
Field Summary | |
protected static transient Log | logger |
Method Summary | |
public static InputStream | SourceToInputStream(Source source) | public static void | createAttribute(Document doc, Element currentNode, String attrName, String attrValue) | public static Document | createDocumentFromString(String xml) | public static Element | createElement(Document doc, String elemName) This function creates a new element and adds it to document. | public static Element | createElement(Document doc, Element parentElem, String elemName) This function creates a new element and adds it to parentElm. | public static Element | createNode(Document doc, Element parentNode, String nodeName, String nodeValue) This function creates a new node and adds it to Parent Element in a given XML document. | public static String | createStringFromDOMDocument(Document document, boolean isXml) | public static String | createStringFromDOMDocument(Document document) | public static String | createStringFromDOMDocumentWithXmlStyle(Document document) | public static String | createStringFromDOMNode(Node node) | public static Node | findChild(Node parent, String nodeName, boolean recursive) Search for a child with the given nodeName. | public static Node | findChild(Node parent, String namespaceURI, String nodeName, boolean recursive) Search for a child with the given nodeName. | public static NodeList | findChildren(Node parent, String namespaceURI, String nodeName, boolean recursive) | public static NodeList | findChildren(Node parent, String nodeName, boolean recursive) Search for children with the given nodeName. | public static String | getAttributeValue(Node n, String attName) | public static NodeList | getChildren(Node parent) | public static synchronized Document | getDomTree(File inFile, File schemaFile) | public static synchronized Document | getDomTree(String xml, File schemaFile) | public static synchronized Document | getDomTree(InputStream s, File schemaFile) | public static synchronized Document | getDomTree(Reader r, File schemaFile) | public static synchronized Document | getDomTree(InputSource source, File schemaFile) | public static Node | getFirstChild(Node node) | public static String | getNamespaceURIForPrefix(Node node, String prefix) | public static String | getNamespaceURIForPrefixRecursive(Node node, String prefix) | public static Node | getNextSibling(Node node) | public static String | getPrefix(String nodeName) | public static String | getPrefixForNamespaceURI(Node node, String namespaceURI) | public static String | getPrefixForNamespaceURIRecursive(Node node, String namespaceURI) | public static String | getTextContent(Node node) | public static String | parseToString(Node node) | public static void | writeDOMSource(DOMSource src, OutputStream os, String charSetName) Write the DOMSource to OutputStream. |
logger | protected static transient Log logger(Code) | | |
createDocumentFromString | public static Document createDocumentFromString(String xml)(Code) | | Create a document from a String
Parameters: xml - xml string document representing the document |
createStringFromDOMDocument | public static String createStringFromDOMDocument(Document document, boolean isXml) throws TransformerException(Code) | | Create a String result from a DOM document
Parameters: document - the DOM Document a String representation of the DOM Document throws: TransformerException - |
createStringFromDOMDocumentWithXmlStyle | public static String createStringFromDOMDocumentWithXmlStyle(Document document) throws TransformerException(Code) | | Create a String result from a DOM document
Parameters: document - the DOM Document a String representation of the DOM Document throws: TransformerException - |
findChild | public static Node findChild(Node parent, String nodeName, boolean recursive)(Code) | | Search for a child with the given nodeName. If recursive, search in all
the child of firdt level, then if not found, search in the 2nd level of
the first child, ...
Parameters: parent - parent node Parameters: nodeName - node name Parameters: recursive - boolean to know if we got through the xml tree a node |
findChild | public static Node findChild(Node parent, String namespaceURI, String nodeName, boolean recursive)(Code) | | Search for a child with the given nodeName. If recursive, search in all
the child of firdt level, then if not found, search in the 2nd level of
the first child, ...
Parameters: parent - parent node Parameters: namespaceURI - The namespaceURI of the node Parameters: nodeName - node name Parameters: recursive - boolean to know if we got through the xml tree a node |
findChildren | public static NodeList findChildren(Node parent, String nodeName, boolean recursive)(Code) | | Search for children with the given nodeName. If recursive, search in all
the children of first level, then search in the 2nd level of the first
children, ...
Parameters: parent - parent node Parameters: nodeName - node name Parameters: recursive - boolean to know if we got through the xml tree a node list of nodes with this name |
getAttributeValue | public static String getAttributeValue(Node n, String attName)(Code) | | Return the value of the attribute in the node
Parameters: n - the node Parameters: attName - the name of the attribute the value of the attribute, null if not found |
getFirstChild | public static Node getFirstChild(Node node)(Code) | | Return the first child of a node, regardless text node
Parameters: node - |
getNamespaceURIForPrefixRecursive | public static String getNamespaceURIForPrefixRecursive(Node node, String prefix)(Code) | | |
getNextSibling | public static Node getNextSibling(Node node)(Code) | | Return the next sibling of a node, regardless text node
Parameters: node - |
getPrefixForNamespaceURI | public static String getPrefixForNamespaceURI(Node node, String namespaceURI)(Code) | | Search a document to see if a namespace is declared in it and if it is
returns this namespace URI
Parameters: node - Parameters: namespaceURI - Parameters: deep - |
getPrefixForNamespaceURIRecursive | public static String getPrefixForNamespaceURIRecursive(Node node, String namespaceURI)(Code) | | |
getTextContent | public static String getTextContent(Node node)(Code) | | Return the text element of a node
The implmentation of the DOM3 getTextContent() API Axiom DOM
implementation doesn't support it
Parameters: node - |
writeDOMSource | public static void writeDOMSource(DOMSource src, OutputStream os, String charSetName) throws Exception(Code) | | Write the DOMSource to OutputStream.
Parameters: src - The DOM source. Parameters: os - The OutputStream. Parameters: charSetName - The character set name for encoding. throws: Exception - |
|
|