public final class Convert extends Object
| Modifier and Type | Method and Description |
|---|---|
static Document |
toDocument(Source s)
Creates a DOM Document from a TraX Source.
|
static Document |
toDocument(Source s,
DocumentBuilderFactory factory)
Creates a DOM Document from a TraX Source.
|
static InputSource |
toInputSource(Source s)
Creates a SAX InputSource from a TraX Source.
|
static InputSource |
toInputSource(Source s,
TransformerFactory fac)
Creates a SAX InputSource from a TraX Source.
|
static NamespaceContext |
toNamespaceContext(Map<String,String> prefix2URI)
Creates a JAXP NamespaceContext from a Map prefix => Namespace URI.
|
static Node |
toNode(Source s)
Creates a DOM Node from a TraX Source.
|
static Node |
toNode(Source s,
DocumentBuilderFactory factory)
Creates a DOM Node from a TraX Source.
|
public static InputSource toInputSource(Source s)
May use an XSLT identity transformation if SAXSource cannot convert it directly.
s - the source to convertpublic static InputSource toInputSource(Source s, 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 default
factory if the value is null.public static Document toDocument(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.
s - the source to convertpublic static Document toDocument(Source s, 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.
s - the source to convertfactory - factory to usepublic static Node toNode(Source s)
If the source is a DOMSource its Node will be
returned, otherwise this delegates to toDocument(javax.xml.transform.Source).
s - the source to convertpublic static Node toNode(Source s, DocumentBuilderFactory factory)
If the source is a DOMSource its Node will be
returned, otherwise this delegates to toDocument(javax.xml.transform.Source).
s - the source to convertfactory - factory to usepublic static NamespaceContext toNamespaceContext(Map<String,String> prefix2URI)
prefix2URI - maps from prefix to namespace URI.Copyright © 2001–2025 XMLUnit. All rights reserved.