|
Milyn-Commons Version 0.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.milyn.xml.XmlUtil
XMl utility methods.
Constructor Summary | |
XmlUtil()
|
Method Summary | |
static org.w3c.dom.Node |
getNode(org.w3c.dom.Node node,
java.lang.String xpath)
Get the W3C Node instance associated with the XPath selection supplied. |
static org.w3c.dom.NodeList |
getNodeList(org.w3c.dom.Node node,
java.lang.String xpath)
Get the W3C NodeList instance associated with the XPath selection supplied. |
static java.lang.String |
getString(org.w3c.dom.Node node,
java.lang.String xpath)
Get the String data associated with the XPath selection supplied. |
static boolean |
isTextNode(org.w3c.dom.Node node)
Is the supplied W3C DOM Node a text node. |
static org.w3c.dom.Document |
parseStream(java.io.InputStream stream,
boolean validate)
Parse the XML stream and return the associated W3C Document object. |
static org.w3c.dom.Document |
parseStream(java.io.InputStream stream,
org.xml.sax.EntityResolver entityResolver,
boolean validate)
Parse the XML stream and return the associated W3C Document object. |
static void |
removeEntities(java.io.Reader reader,
java.io.Writer writer)
Remove all entities from the supplied Reader stream replacing
them with their actual character values. |
static java.lang.String |
removeEntities(java.lang.String string)
Remove all entities from the supplied String stream replacing
them with there actual character values. |
static void |
rewriteEntities(java.io.Reader reader,
java.io.Writer writer)
Rewrite all entities from the supplied Reader stream replacing
them with their character reference equivalents. |
static java.lang.String |
serialize(org.w3c.dom.NodeList nodeList)
Serialise the supplied W3C DOM subtree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlUtil()
Method Detail |
public static void removeEntities(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException
Reader
stream replacing
them with their actual character values.
Both the read and write streams are returned unclosed.
reader
- The read stream.writer
- The write stream.
java.io.IOException
public static java.lang.String removeEntities(java.lang.String string)
String
stream replacing
them with there actual character values.
string
- The string on which the operation is to be carried out.
public static void rewriteEntities(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException
Reader
stream replacing
them with their character reference equivalents.
Example:   is rewriten as  
Both the read and write streams are returned unclosed.
reader
- The read stream.writer
- The write stream.
java.io.IOException
public static org.w3c.dom.Document parseStream(java.io.InputStream stream, boolean validate) throws org.xml.sax.SAXException, java.io.IOException
stream
- The stream to be parsed.validate
- True if the document is to be validated, otherwise false.
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document parseStream(java.io.InputStream stream, org.xml.sax.EntityResolver entityResolver, boolean validate) throws org.xml.sax.SAXException, java.io.IOException
stream
- The stream to be parsed.entityResolver
- Entity resolver to be used during the parse.validate
- True if the document is to be validated, otherwise false.
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.NodeList getNodeList(org.w3c.dom.Node node, java.lang.String xpath)
node
- The document node to be searched.xpath
- The XPath String to be used in the selection.
public static org.w3c.dom.Node getNode(org.w3c.dom.Node node, java.lang.String xpath)
node
- The document node to be searched.xpath
- The XPath String to be used in the selection.
public static java.lang.String getString(org.w3c.dom.Node node, java.lang.String xpath)
xpath
- The XPath String to be used in the selection.
public static java.lang.String serialize(org.w3c.dom.NodeList nodeList) throws org.w3c.dom.DOMException
nodeList
- The DOM subtree as a NodeList.
org.w3c.dom.DOMException
- Unable to serialise the DOM.public static boolean isTextNode(org.w3c.dom.Node node)
node
- The node to be tested.
|
Milyn-Commons Version 0.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |