|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ebmwebsourcing.easycommons.xml.XMLHelper
public final class XMLHelper
Utilities methods for XML operations
| Constructor Summary | |
|---|---|
XMLHelper()
|
|
| Method Summary | |
|---|---|
static org.w3c.dom.Document |
createDocumentFromString(java.lang.String xml)
Create a DOM document from the specified XML string |
static java.lang.String |
createStringFromDOMDocument(org.w3c.dom.Node document)
Create a String result from a DOM document |
static java.lang.String |
createStringFromDOMNode(org.w3c.dom.Node node)
Create a String result from a DOM Node |
static java.lang.String |
createStringFromDOMNode(org.w3c.dom.Node node,
boolean omitDeclaration)
Create a String result from a DOM Node |
static org.w3c.dom.Node |
findChild(org.w3c.dom.Node parentNode,
java.lang.String namespaceURI,
java.lang.String nodeName,
boolean recursive)
Search for the first child of the specified parent node with the specified namespace URI and local name. |
static java.lang.String |
toString(org.w3c.dom.NodeList list)
Create a String from a Node list |
static void |
writeDocument(org.w3c.dom.Document document,
java.io.OutputStream outputStream)
Write a document to an output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLHelper()
| Method Detail |
|---|
public static final java.lang.String toString(org.w3c.dom.NodeList list)
String from a Node list
list - a node list
public static final java.lang.String createStringFromDOMDocument(org.w3c.dom.Node document)
throws javax.xml.transform.TransformerException
document - the DOM Document. It must not be null
javax.xml.transform.TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final java.lang.String createStringFromDOMNode(org.w3c.dom.Node node)
throws javax.xml.transform.TransformerException
node - the DOM Node. It must not be null
javax.xml.transform.TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final java.lang.String createStringFromDOMNode(org.w3c.dom.Node node,
boolean omitDeclaration)
throws javax.xml.transform.TransformerException
node - the DOM Node. It must not be nullomitDeclaration - a flag to indicate to omit the XML declaration
javax.xml.transform.TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final void writeDocument(org.w3c.dom.Document document,
java.io.OutputStream outputStream)
throws javax.xml.transform.TransformerException
document - the document to write to the output streamoutputStream - the output stream to write the document
javax.xml.transform.TransformerException - if an unrecoverable error occurs during the course of the
transformation
PoolException - This method uses a transformer got from a transformer pool.
This unchecked exception is thrown if the current thread
waits for a transformer of the pool and is interrupted (as
the pool policy is WAIT)
public static final org.w3c.dom.Document createDocumentFromString(java.lang.String xml)
throws org.xml.sax.SAXException,
java.io.IOException
xml - a XML string
java.io.IOException - If any IO errors occur
org.xml.sax.SAXException - If any parse errors occur
PoolException - This method uses a document builder got from a document
builder pool. This unchecked exception is thrown if the
current thread waits for a document builder of the pool and
is interrupted (as the pool policy is WAIT)
public static final org.w3c.dom.Node findChild(org.w3c.dom.Node parentNode,
java.lang.String namespaceURI,
java.lang.String nodeName,
boolean recursive)
parentNode - a parent nodenamespaceURI - the namespace URI of the node to search. if null, the namespace
is ignorednodeName - the local name of the node to searchrecursive - a flag to know the search is recursive in the XML tree
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||