|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wamblee.xml.DomUtils
public final class DomUtils
Some basic XML utilities for common reoccuring tasks for DOM documents.
| Method Summary | |
|---|---|
static org.w3c.dom.Document |
convert(org.dom4j.Document aDocument)
Converts a dom4j document into a w3c DOM document. |
static org.dom4j.Document |
convert(org.w3c.dom.Document aDocument)
Converts a W3C DOM document into a dom4j document. |
static org.w3c.dom.Document |
read(java.io.InputStream aIs)
Parses an XML document from a stream. |
static org.w3c.dom.Document |
read(java.lang.String aDocument)
Parses an XML document from a string. |
static org.w3c.dom.Document |
readAndValidate(java.io.InputStream aIs,
java.io.InputStream aSchema)
Reads and validates a document against a schema. |
static void |
removeDuplicateAttributes(org.w3c.dom.Node aNode)
Removes duplicate attributes from a DOM tree.This is useful for postprocessing the output of JTidy as a workaround for a bug in JTidy. |
static java.lang.String |
serialize(org.w3c.dom.Document aDocument)
Serializes an XML document. |
static void |
serialize(org.w3c.dom.Document aDocument,
java.io.OutputStream aOs)
Serializes an XML document to a stream. |
| 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 read(java.lang.String aDocument)
throws XMLException
aDocument - document.
XMLException
public static org.w3c.dom.Document read(java.io.InputStream aIs)
throws XMLException
aIs - Input stream.
XMLException
public static org.w3c.dom.Document readAndValidate(java.io.InputStream aIs,
java.io.InputStream aSchema)
throws XMLException
aIs - Input stream.aSchema - Schema.
XMLException
public static void serialize(org.w3c.dom.Document aDocument,
java.io.OutputStream aOs)
throws java.io.IOException
aDocument - Document to serialize.aOs - Output stream.
java.io.IOException
public static java.lang.String serialize(org.w3c.dom.Document aDocument)
throws java.io.IOException
aDocument - Document to serialize.
java.io.IOException
public static org.w3c.dom.Document convert(org.dom4j.Document aDocument)
throws org.dom4j.DocumentException
aDocument - Document to convert.
org.dom4j.DocumentExceptionpublic static org.dom4j.Document convert(org.w3c.dom.Document aDocument)
aDocument - Document to convert.
public static void removeDuplicateAttributes(org.w3c.dom.Node aNode)
aNode - Node to remove duplicate attributes from (recursively).
Attributes of the node itself are not dealt with. Only the
child nodes are dealt with.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||