public class XMLLib
extends java.lang.Object
RDC: added a bunch of DOM functions.
| Constructor and Description |
|---|
XMLLib() |
| Modifier and Type | Method and Description |
|---|---|
static org.w3c.dom.Document |
createDocument(org.w3c.dom.Node document)
Creates a new document with a copy of the given element as the document
element.
|
static java.lang.String |
escapeAttribute(java.lang.String original)
Replaces reserved XML characters with entity references.
|
static java.lang.String |
escapeContent(java.lang.String original)
Replaces reserved XML characters with entity references.
|
static java.lang.String |
escapeString(java.lang.String original) |
static boolean |
isAncestor(org.w3c.dom.Node parentToCheck,
org.w3c.dom.Node child) |
static void |
logNode(org.w3c.dom.Node node)
Writes the node out to the log.
|
static org.w3c.dom.Document |
open(java.io.File file) |
static org.w3c.dom.Document |
open(java.io.InputStream instr) |
static org.w3c.dom.Document |
open(java.lang.String filename) |
static java.lang.String |
unescape(java.lang.String original)
Replaces entity references for XML reserved characters with their
character form.
|
static void |
write(org.w3c.dom.Node document,
java.io.File file)
Writes document as the document element of a new document.
|
static void |
write(org.w3c.dom.Node document,
java.lang.String filename)
Writes document as the document element of a new document.
|
public static java.lang.String escapeString(java.lang.String original)
public static java.lang.String escapeContent(java.lang.String original)
Currently replaces the following:
public static java.lang.String escapeAttribute(java.lang.String original)
Currently replaces the following:
public static java.lang.String unescape(java.lang.String original)
public static org.w3c.dom.Document open(java.lang.String filename)
throws java.lang.Exception
java.lang.Exceptionpublic static org.w3c.dom.Document open(java.io.File file)
throws java.lang.Exception
java.lang.Exceptionpublic static org.w3c.dom.Document open(java.io.InputStream instr)
throws java.lang.Exception
java.lang.Exceptionpublic static void write(org.w3c.dom.Node document,
java.lang.String filename)
throws java.lang.Exception
java.lang.Exceptionpublic static void write(org.w3c.dom.Node document,
java.io.File file)
throws java.lang.Exception
java.lang.Exceptionpublic static org.w3c.dom.Document createDocument(org.w3c.dom.Node document)
public static void logNode(org.w3c.dom.Node node)
throws java.lang.Exception
java.lang.Exceptionpublic static boolean isAncestor(org.w3c.dom.Node parentToCheck,
org.w3c.dom.Node child)