public class XmlUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XmlUtil.ObjectNotationTransformerHandler |
static interface |
XmlUtil.ObjectNotationWriter |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASSOCIATION_TAG
Tag name for embedding associated entities.
|
static java.lang.String |
NS_PREFIX
Jailer namespace URI.
|
static java.lang.String |
NS_URI
Jailer namespace URI.
|
static java.lang.String |
SQL_PREFIX
Prefix for SQL expressions.
|
Constructor and Description |
---|
XmlUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
asElementName(java.lang.String x)
Removes invalid char from element names.
|
static java.lang.String |
build(org.w3c.dom.Document xmlDocument)
Generates a XML string from DOM.
|
static java.lang.String |
buildOmitDeclaration(org.w3c.dom.Document xmlDocument)
Generates a XML string from DOM without XML declaration.
|
static XmlUtil.ObjectNotationTransformerHandler |
createObjectNotationTransformerHandler(java.lang.String commentHeader,
java.lang.String rootTag,
java.io.Writer out,
boolean forSketch,
ScriptFormat scriptFormat,
java.text.SimpleDateFormat datePattern,
java.text.SimpleDateFormat timestampPattern,
ExecutionContext executionContext) |
static javax.xml.transform.sax.TransformerHandler |
createTransformerHandler(java.lang.String commentHeader,
java.lang.String rootTag,
javax.xml.transform.stream.StreamResult streamResult,
java.nio.charset.Charset charset,
ExecutionContext executionContext)
Creates a
TransformerHandler . |
static org.w3c.dom.Document |
parse(java.lang.String xml)
Parses a XML document.
|
static void |
visitDocumentNodes(org.w3c.dom.Document document,
NodeVisitor visitor)
Visits the nodes of
Document . |
public static final java.lang.String NS_URI
public static final java.lang.String NS_PREFIX
public static final java.lang.String ASSOCIATION_TAG
public static final java.lang.String SQL_PREFIX
public static org.w3c.dom.Document parse(java.lang.String xml) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
xml
- the XML documentjavax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public static java.lang.String buildOmitDeclaration(org.w3c.dom.Document xmlDocument) throws javax.xml.transform.TransformerException
xmlDocument
- the DOMjavax.xml.transform.TransformerException
public static java.lang.String build(org.w3c.dom.Document xmlDocument) throws javax.xml.transform.TransformerException
xmlDocument
- the DOMjavax.xml.transform.TransformerException
public static java.lang.String asElementName(java.lang.String x)
public static void visitDocumentNodes(org.w3c.dom.Document document, NodeVisitor visitor)
Document
.document
- the documentvisitor
- the visitorpublic static javax.xml.transform.sax.TransformerHandler createTransformerHandler(java.lang.String commentHeader, java.lang.String rootTag, javax.xml.transform.stream.StreamResult streamResult, java.nio.charset.Charset charset, ExecutionContext executionContext) throws org.xml.sax.SAXException
TransformerHandler
.commentHeader
- the comment headerrootTag
- the root tagstreamResult
- stream resultexecutionContext
- org.xml.sax.SAXException
public static XmlUtil.ObjectNotationTransformerHandler createObjectNotationTransformerHandler(java.lang.String commentHeader, java.lang.String rootTag, java.io.Writer out, boolean forSketch, ScriptFormat scriptFormat, java.text.SimpleDateFormat datePattern, java.text.SimpleDateFormat timestampPattern, ExecutionContext executionContext)