|
||||||||||
| 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 Document |
read(InputStream aIs)
Parses an XML document from a stream. |
static Document |
read(String aDocument)
Parses an XML document from a string. |
static Document |
readAndValidate(InputStream aIs,
InputStream aSchema)
Reads and validates a document against a schema. |
static void |
removeDuplicateAttributes(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 String |
serialize(Document aDocument)
Serializes an XML document. |
static void |
serialize(Document aDocument,
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 Document read(String aDocument)
throws XMLException
aDocument - document.
XMLException
public static Document read(InputStream aIs)
throws XMLException
aIs - Input stream.
XMLException
public static Document readAndValidate(InputStream aIs,
InputStream aSchema)
throws XMLException
aIs - Input stream.aSchema - Schema.
XMLException
public static void serialize(Document aDocument,
OutputStream aOs)
throws IOException
aDocument - Document to serialize.aOs - Output stream.
IOException
public static String serialize(Document aDocument)
throws IOException
aDocument - Document to serialize.
IOExceptionpublic static void removeDuplicateAttributes(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 | |||||||||