| java.lang.Object com.caucho.xml2.XmlUtil
XmlUtil | public class XmlUtil (Code) | | XML utilities for manipulating names and the DOM.
|
getNamespace | public static String getNamespace(Node node, String prefix)(Code) | | Returns the namespace for the given prefix.
|
getNext | public static Node getNext(Node node)(Code) | | Get the next node in a depth first preorder traversal.
- If the node has a child, return the child
- Else if the node has a following sibling, return that sibling
- Else if the node has a following uncle, return that uncle
Parameters: node - the current node the next node in the preorder traversal |
getPIAttribute | public static String getPIAttribute(String pi, String key)(Code) | | Extracts an attribute from a processing instruction. Since
processing instructions are opaque, the standard DOM has no API
for the common case where the PI value is an attribute list.
<?xml-stylesheet href="default.xsl"?>
In the above example,
getPIAttribute(node.getNodeValue(), "href")
would return "default.xsl".
Parameters: pi - the value of the processing instruction Parameters: key - the attribute key the value corresponding to the attribute key. |
getPrevious | public static Node getPrevious(Node node)(Code) | | Get the previous node in a DFS preorder traversal
Parameters: node - the current node the previous node in the preorder traversal |
isWhitespace | public static boolean isWhitespace(String text)(Code) | | Extracts the text value from the node. Text nodes return their
value and elements return the concatenation of the child values.
|
splitNameList | public static HashMap<String, String> splitNameList(String name) throws IOException(Code) | | Treats the string as an attribute list, splitting it into a HashMap.
Parameters: name - a string to be interpreted as an attribute list a hash map containing the attribute (key, value) pairs. |
textValue | public static String textValue(Node node)(Code) | | Extracts the text value from the node. Text nodes return their
value and elements return the concatenation of the child values.
|
textValue | public static void textValue(CharBuffer cb, Node node)(Code) | | Extracts the text value from the node. Text nodes return their
value and elements return the concatenation of the child values.
|
|
|