|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaito.util.XMLTools
public class XMLTools
This class that holds a couple of useful methods for accessing xml data and writing an xml document to a file. This class is NOT an all purpose xml utility kit. The methods that are included are designed only to be used by this program.
Method Summary | |
---|---|
static java.lang.String[] |
getAllContents(javax.xml.parsers.DocumentBuilder builder,
java.io.InputStream xml,
java.lang.String xpathExpression)
Returns the text content of one or more elements in an XML document. |
static java.lang.String |
getNodeContent(javax.xml.parsers.DocumentBuilder builder,
java.io.InputStream xml,
java.lang.String xpathExpression)
Returns the text content of an element in an XML document. |
static java.io.File |
writeDocumentToFile(org.w3c.dom.Document doc,
java.lang.String filename)
Writes a 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 java.lang.String getNodeContent(javax.xml.parsers.DocumentBuilder builder, java.io.InputStream xml, java.lang.String xpathExpression) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException
builder
- Used in building a org.w3c.dom.Document
object.xml
- Must be an InputStream which contains a valid xml document.xpathExpression
- An XPath expression which determines the target node in the document
null
if the value or node is not available.
java.io.IOException
org.xml.sax.SAXException
javax.xml.xpath.XPathExpressionException
public static java.lang.String[] getAllContents(javax.xml.parsers.DocumentBuilder builder, java.io.InputStream xml, java.lang.String xpathExpression) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException
builder
- Used in building a org.w3c.dom.Document
object.xml
- Must be an InputStream which contains a valid xml document.xpathExpression
- An XPath expression which determines the target node(s) in the document.
null
if no match is found.
java.io.IOException
org.xml.sax.SAXException
javax.xml.xpath.XPathExpressionException
public static java.io.File writeDocumentToFile(org.w3c.dom.Document doc, java.lang.String filename)
doc
- filename
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |