public class XmlUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ASSOCIATION_TAG
Tag name for embedding associated entities.
|
static String |
NS_PREFIX
Jailer namespace URI.
|
static String |
NS_URI
Jailer namespace URI.
|
static String |
SQL_PREFIX
Prefix for SQL expressions.
|
| Constructor and Description |
|---|
XmlUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asElementName(String x)
Removes invalid char from element names.
|
static String |
build(Document xmlDocument)
Generates a XML string from DOM.
|
static String |
buildOmitDeclaration(Document xmlDocument)
Generates a XML string from DOM without XML declaration.
|
static TransformerHandler |
createTransformerHandler(String commentHeader,
String rootTag,
StreamResult streamResult,
Charset charset)
Creates a
TransformerHandler. |
static Document |
parse(String xml)
Parses a XML document.
|
static void |
visitDocumentNodes(Document document,
NodeVisitor visitor)
Visits the nodes of
Document. |
public static final String NS_URI
public static final String NS_PREFIX
public static final String ASSOCIATION_TAG
public static final String SQL_PREFIX
public static Document parse(String xml) throws ParserConfigurationException, SAXException, IOException
xml - the XML documentParserConfigurationExceptionSAXExceptionIOExceptionpublic static String buildOmitDeclaration(Document xmlDocument) throws TransformerException
xmlDocument - the DOMTransformerExceptionpublic static String build(Document xmlDocument) throws TransformerException
xmlDocument - the DOMomitXMLDeclaration - TransformerExceptionpublic static void visitDocumentNodes(Document document, NodeVisitor visitor)
Document.document - the documentvisitor - the visitorpublic static TransformerHandler createTransformerHandler(String commentHeader, String rootTag, StreamResult streamResult, Charset charset) throws SAXException
TransformerHandler.commentHeader - the comment headerrootTag - the root tagstreamResult - stream resultSAXException