public final class Convert
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Convert() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Document |
toDocument(javax.xml.transform.Source s)
Creates a DOM Document from a TraX Source.
|
static org.w3c.dom.Document |
toDocument(javax.xml.transform.Source s,
javax.xml.parsers.DocumentBuilderFactory factory)
Creates a DOM Document from a TraX Source.
|
static org.xml.sax.InputSource |
toInputSource(javax.xml.transform.Source s)
Creates a SAX InputSource from a TraX Source.
|
static org.xml.sax.InputSource |
toInputSource(javax.xml.transform.Source s,
javax.xml.transform.TransformerFactory fac)
Creates a SAX InputSource from a TraX Source.
|
static javax.xml.namespace.NamespaceContext |
toNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2URI)
Creates a JAXP NamespaceContext from a Map prefix => Namespace URI.
|
static org.w3c.dom.Node |
toNode(javax.xml.transform.Source s)
Creates a DOM Node from a TraX Source.
|
static org.w3c.dom.Node |
toNode(javax.xml.transform.Source s,
javax.xml.parsers.DocumentBuilderFactory factory)
Creates a DOM Node from a TraX Source.
|
private static org.w3c.dom.Document |
tryExtractDocFromDOMSource(javax.xml.transform.Source s) |
private static org.w3c.dom.Node |
tryExtractNodeFromDOMSource(javax.xml.transform.Source s) |
public static org.xml.sax.InputSource toInputSource(javax.xml.transform.Source s)
May use an XSLT identity transformation if SAXSource cannot convert it directly.
s
- the source to convertpublic static org.xml.sax.InputSource toInputSource(javax.xml.transform.Source s, javax.xml.transform.TransformerFactory fac)
May use an XSLT identity transformation if SAXSource cannot convert it directly.
s
- the source to convertfac
- the TransformerFactory to use, will use the defaul
factory if the value is null.public static org.w3c.dom.Document toDocument(javax.xml.transform.Source s)
If the source is a DOMSource
holding a Document
Node, this one will be returned. Otherwise toInputSource(javax.xml.transform.Source)
and a namespace aware DocumentBuilder (created
by the default DocumentBuilderFactory) will be used to read the
source. This may involve an XSLT identity transform in
toInputSource.
public static org.w3c.dom.Document toDocument(javax.xml.transform.Source s, javax.xml.parsers.DocumentBuilderFactory factory)
If the source is a DOMSource
holding a Document
Node, this one will be returned. Otherwise toInputSource(javax.xml.transform.Source)
and a namespace aware DocumentBuilder (created
by given DocumentBuilderFactory) will be used to read the
source. This may involve an XSLT identity transform in
toInputSource.
private static org.w3c.dom.Document tryExtractDocFromDOMSource(javax.xml.transform.Source s)
public static org.w3c.dom.Node toNode(javax.xml.transform.Source s)
If the source is a DOMSource
its Node will be
returned, otherwise this delegates to toDocument(javax.xml.transform.Source)
.
public static org.w3c.dom.Node toNode(javax.xml.transform.Source s, javax.xml.parsers.DocumentBuilderFactory factory)
If the source is a DOMSource
its Node will be
returned, otherwise this delegates to toDocument(javax.xml.transform.Source)
.
private static org.w3c.dom.Node tryExtractNodeFromDOMSource(javax.xml.transform.Source s)
public static javax.xml.namespace.NamespaceContext toNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2URI)