public class DocumentWrapper extends GenericTreeInfo
Because the DOM is not thread-safe even when reading, and because Saxon-EE can spawn multiple threads that access the same input tree, all methods that invoke DOM methods are synchronized on the Document node
| Modifier and Type | Field and Description |
|---|---|
Node |
docNode |
protected boolean |
domLevel3 |
| Constructor and Description |
|---|
DocumentWrapper(Node doc,
String baseURI,
Configuration config)
Wrap a DOM Document or DocumentFragment node
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDOMLevel()
Get the level of DOM interface to be used
|
String[] |
getUnparsedEntity(String name)
Get the unparsed entity with a given name
|
Iterator<String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
NodeInfo |
selectID(String id,
boolean getParent)
Get the element with a given ID, if any
|
void |
setDOMLevel(int level)
Set the level of DOM interface to be used
|
DOMNodeWrapper |
wrap(Node node)
Create a wrapper for a node in this document
|
getConfiguration, getDocumentNumber, getPublicId, getRootNode, getSystemId, getUserData, isTyped, setConfiguration, setDocumentNumber, setRootNode, setSystemId, setUserDataprotected boolean domLevel3
public Node docNode
public DocumentWrapper(Node doc, String baseURI, Configuration config)
doc - a DOM Document or DocumentFragment nodebaseURI - the base URI of the documentconfig - the Saxon configurationpublic DOMNodeWrapper wrap(Node node)
node - the DOM node to be wrapped. This must be a node within the document wrapped by this
DocumentWrapperIllegalArgumentException - if the node is not a descendant of the Document node wrapped by
this DocumentWrapperpublic void setDOMLevel(int level)
level - the DOM level. Must be 2 or 3. By default Saxon assumes that DOM level 3 is available;
this parameter can be set to the value 2 to indicate that Saxon should not use methods unless they
are available in DOM level 2. From Saxon 9.2, this switch remains available, but the use of
DOM level 2 is untested and unsupported.public int getDOMLevel()
public NodeInfo selectID(String id, boolean getParent)
selectID in interface TreeInfoselectID in class GenericTreeInfoid - the required ID valuegetParent - true if the parent of the element having the given ID value is requiredpublic Iterator<String> getUnparsedEntityNames()
getUnparsedEntityNames in interface TreeInfogetUnparsedEntityNames in class GenericTreeInfopublic String[] getUnparsedEntity(String name)
getUnparsedEntity in interface TreeInfogetUnparsedEntity in class GenericTreeInfoname - the name of the entityCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.