| java.lang.Object org.lateralnz.common.util.XMLUtils
XMLUtils | final public class XMLUtils implements Constants(Code) | | common XML utility functions
author: J R Briggs |
flatten | final public static String flatten(Node xml)(Code) | | flatten an XML node into a string (reverse parse?)
|
getAttributeValue | final public static String getAttributeValue(Node xml, String attribute, String def) throws Exception(Code) | | get the value of an xml attribute. For example, given:
something
calling getattribute(node, "att2", "blah") should return "test2"
|
getFirstChildElementValue | final public static String getFirstChildElementValue(Element e, String elemName)(Code) | | get the 'first child' element value of an element
|
getNamedNode | final public static Node getNamedNode(Node node, String name)(Code) | | get the first node with a specified name
|
getNodeType | final public static String getNodeType(Node n)(Code) | | get the node type as text
|
getNodeValue | final public static String getNodeValue(Node n)(Code) | | return the value of a node
|
getNodesByName | final public static List getNodesByName(Node node, String name)(Code) | | get a list of XML nodes based upon their nodename
|
hasAttribute | final public static boolean hasAttribute(Node xml, String attribute) throws Exception(Code) | | return true if a node contains an attribute
|
preprocess | final public static String preprocess(String xml) throws Exception(Code) | | preprocess and xml string, removing all leading and trailing whitespace
from each line, and removing carriage returns and newlines from each line
except where they fall within a CDATA section.
|
|
|