|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.util.xml.XmlUtils
public final class XmlUtils
XML utilities class.
| Field Summary | |
|---|---|
static NodeList |
EMPTY_NODE_LIST
Empty list of XML nodes. |
| Constructor Summary | |
|---|---|
XmlUtils()
|
|
| Method Summary | |
|---|---|
static void |
printDoc(Document doc)
Prints the XML Document to standard out with handy indentation. |
static void |
printDoc(String xml)
|
static void |
replaceNodeValue(Document doc,
String xPath,
String newValue)
Replaces the text value of a node in a document with the specified value using XPath. |
static Document |
toDoc(InputStream is)
|
static Document |
toDoc(InputStream is,
String endStatementTag)
|
static Document |
toDoc(String str)
|
static String |
toString(Document doc)
Returns the XML Document as a readable string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final NodeList EMPTY_NODE_LIST
| Constructor Detail |
|---|
public XmlUtils()
| Method Detail |
|---|
public static void replaceNodeValue(Document doc,
String xPath,
String newValue)
doc - The document to modify.xPath - The XPath string to locate the node to modify. This
should point to the Node containing a Text node as its
first child.newValue - The new text value to place in the node.public static void printDoc(Document doc)
Document to standard out with handy indentation.
doc - The Document to print.public static String toString(Document doc)
Document as a readable string.
doc - The Document to convert to a string.
String.
public static Document toDoc(String str)
throws IOException,
SAXException
IOException
SAXException
public static Document toDoc(InputStream is)
throws IOException,
SAXException
IOException
SAXException
public static Document toDoc(InputStream is,
String endStatementTag)
throws IOException,
SAXException
IOException
SAXExceptionpublic static void printDoc(String xml)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||