|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.markup.XMLUtil
public final class XMLUtil
Provides methods for general use.
| Method Summary | |
|---|---|
static boolean |
compareStringNode(org.w3c.dom.Node node,
java.lang.String tag)
Checks if a node resembles the given XML tag (including attributes). |
static org.w3c.dom.Element |
getChildElement(org.w3c.dom.Node parent,
java.lang.String childName)
Gets a named child node. |
static org.w3c.dom.Element[] |
getChildElements(org.w3c.dom.Node parent,
java.lang.String childName)
Gets a named child elements in flat level. |
static org.w3c.dom.Element[] |
getChildElements(org.w3c.dom.Node parent,
java.lang.String[] childNames)
Gets a named child elements in flat level. |
static org.w3c.dom.Node |
getChildNode(org.w3c.dom.Node parent,
java.lang.String childName)
Deprecated. getChildElement(org.w3c.dom.Node, java.lang.String) |
static org.w3c.dom.Node |
getChildNode(org.w3c.dom.Node parent,
java.lang.String childName,
short nodeType)
Gets a named child node by the node type. |
static java.lang.String |
getChildNodeValue(org.w3c.dom.Node parent,
java.lang.String childName)
Gets the text value of a named child node. |
static java.lang.String |
getChildNodeValue(org.w3c.dom.Node parent,
java.lang.String childName,
short nodeType)
Gets the text value of a named child node. |
static java.lang.String |
getNodeValue(org.w3c.dom.Node node)
Gets the text value of a node. |
static org.w3c.dom.Document |
parseDocument(org.xml.sax.InputSource is)
Parses an input source and creates a document from it. |
static org.w3c.dom.Document |
parseDocument(java.lang.String fileName)
Parses an input file and creates a document from it. |
static org.w3c.dom.Document |
parseDocument(java.lang.String fileName,
java.util.Map substitute)
Parses an input file and creates a document from it. |
static java.lang.String |
serialize(org.w3c.dom.Document document)
Serializes the XML node tree to a string. |
static void |
serialize(org.w3c.dom.Document document,
java.lang.String fileName)
Serializes the XML document to a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.w3c.dom.Document parseDocument(org.xml.sax.InputSource is)
throws java.io.IOException,
org.xml.sax.SAXException
is - XML input source
java.io.IOException - On error
org.xml.sax.SAXException
public static org.w3c.dom.Document parseDocument(java.lang.String fileName)
throws java.io.IOException,
org.xml.sax.SAXException
fileName - Name of file to read
java.io.IOException - On error
org.xml.sax.SAXException - On error
public static org.w3c.dom.Document parseDocument(java.lang.String fileName,
java.util.Map substitute)
throws java.io.IOException,
org.xml.sax.SAXException
fileName - Name of file to readsubstitute - Map mapping parameter keys to values or null
java.io.IOException - On error
org.xml.sax.SAXException - On error
public static void serialize(org.w3c.dom.Document document,
java.lang.String fileName)
throws java.io.IOException
document - Document or nullfileName - Name of the file to serialize into
java.io.IOException - Error on converting or writing file
public static java.lang.String serialize(org.w3c.dom.Document document)
throws java.io.IOException
document - XML node or null
java.io.IOException - Error on converting
public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parent,
java.lang.String childName)
getChildElement(org.w3c.dom.Node, java.lang.String)
parent - Parent nodechildName - Name of the child node or null for the first child
public static org.w3c.dom.Element getChildElement(org.w3c.dom.Node parent,
java.lang.String childName)
parent - Parent nodechildName - Name of the child node or null for the first child
public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parent,
java.lang.String childName,
short nodeType)
parent - Parent nodechildName - Name of the child node or null for the first childnodeType - see types of interface Node
public static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Node parent,
java.lang.String childName)
parent - Parent nodechildName - Name of the child node or null for the first child
public static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Node parent,
java.lang.String[] childNames)
parent - Parent nodechildNames - Names of the child node or null for the first child
public static java.lang.String getChildNodeValue(org.w3c.dom.Node parent,
java.lang.String childName)
getNodeValue(org.w3c.dom.Node) method
is applied to it.
parent - Parent nodechildName - Name of the child node or null for the first child
public static java.lang.String getChildNodeValue(org.w3c.dom.Node parent,
java.lang.String childName,
short nodeType)
getNodeValue(org.w3c.dom.Node) method
is applied to it.
parent - Parent nodechildName - Name of the child node or null for the first childnodeType - see types of interface Node
public static java.lang.String getNodeValue(org.w3c.dom.Node node)
node - Node to check
public static boolean compareStringNode(org.w3c.dom.Node node,
java.lang.String tag)
node - Node to comparetag - XML tag to compare, e. g. '
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||