Package net.sf.saxon.pull
Class UnconstructedDocument
- java.lang.Object
-
- net.sf.saxon.pull.UnconstructedParent
-
- net.sf.saxon.pull.UnconstructedDocument
-
- All Implemented Interfaces:
javax.xml.transform.Source,DocumentInfo,Item,NodeInfo,ValueRepresentation
public class UnconstructedDocument extends UnconstructedParent implements DocumentInfo
A document node whose construction is deferred. (TODO) NOTE: this class is an exception to the general rule that for document nodes, node identity implies object identity
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.pull.UnconstructedParent
instruction, node, savedXPathContext
-
Fields inherited from interface net.sf.saxon.om.NodeInfo
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
-
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
-
Constructor Summary
Constructors Constructor Description UnconstructedDocument(DocumentInstr instruction, XPathContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseURI()Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node.java.lang.StringgetDisplayName()Get the display name of this node.DocumentInfogetDocumentRoot()Get the root node, if it is a document node.intgetFingerprint()Get fingerprint.java.lang.StringgetLocalPart()Get the local part of the name of this node.intgetNameCode()Get name code.intgetNodeKind()Get the kind of node.java.lang.StringgetPrefix()Get the prefix of the name of the node.java.lang.String[]getUnparsedEntity(java.lang.String name)Get the unparsed entity with a given namejava.lang.StringgetURI()Get the URI part of the name of this node.NodeInfoselectID(java.lang.String id)Get the element with a given ID, if any-
Methods inherited from class net.sf.saxon.pull.UnconstructedParent
atomize, compareOrder, construct, copy, equals, generateId, getAttributeValue, getConfiguration, getDeclaredNamespaces, getDocumentNumber, getInstruction, getLineNumber, getNamePool, getParent, getPuller, getRoot, getStringValue, getStringValueCS, getSystemId, getTypeAnnotation, getTypedValue, getXPathContext, hasChildNodes, hashCode, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations, setSystemId, tryToConstruct
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.Item
getStringValueCS, getTypedValue
-
Methods inherited from interface net.sf.saxon.om.NodeInfo
atomize, compareOrder, copy, equals, generateId, getAttributeValue, getConfiguration, getDeclaredNamespaces, getDocumentNumber, getLineNumber, getNamePool, getParent, getRoot, getStringValue, getSystemId, getTypeAnnotation, hasChildNodes, hashCode, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations
-
-
-
-
Constructor Detail
-
UnconstructedDocument
public UnconstructedDocument(DocumentInstr instruction, XPathContext context)
-
-
Method Detail
-
getNameCode
public int getNameCode()
Get name code. The name code is a coded form of the node name: two nodes with the same name code have the same namespace URI, the same local name, and the same prefix. By masking the name code with &0xfffff, you get a fingerprint: two nodes with the same fingerprint have the same local name and namespace URI.- Specified by:
getNameCodein interfaceNodeInfo- Returns:
- an integer name code, which may be used to obtain the actual node name from the name pool
- See Also:
allocate,getFingerprint
-
getNodeKind
public int getNodeKind()
Description copied from interface:NodeInfoGet the kind of node. This will be a value such asType.ELEMENTorType.ATTRIBUTE. There are seven kinds of node: documents, elements, attributes, text, comments, processing-instructions, and namespaces.- Specified by:
getNodeKindin interfaceNodeInfo- Returns:
- an integer identifying the kind of node. These integer values are the same as those used in the DOM
- See Also:
Type
-
getFingerprint
public int getFingerprint()
Get fingerprint. The fingerprint is a coded form of the expanded name of the node: two nodes with the same name code have the same namespace URI and the same local name. A fingerprint of -1 should be returned for a node with no name.- Specified by:
getFingerprintin interfaceNodeInfo- Overrides:
getFingerprintin classUnconstructedParent- Returns:
- an integer fingerprint; two nodes with the same fingerprint have the same expanded QName
-
getLocalPart
public java.lang.String getLocalPart()
Get the local part of the name of this node. This is the name after the ":" if any.- Specified by:
getLocalPartin interfaceNodeInfo- Overrides:
getLocalPartin classUnconstructedParent- Returns:
- the local part of the name. For an unnamed node, returns "". Unlike the DOM interface, this returns the full name in the case of a non-namespaced name.
-
getURI
public java.lang.String getURI()
Get the URI part of the name of this node. This is the URI corresponding to the prefix, or the URI of the default namespace if appropriate.- Specified by:
getURIin interfaceNodeInfo- Overrides:
getURIin classUnconstructedParent- Returns:
- The URI of the namespace of this node. For an unnamed node, or for a node with an empty prefix, return an empty string.
-
getDisplayName
public java.lang.String getDisplayName()
Get the display name of this node. For elements and attributes this is [prefix:]localname. For unnamed nodes, it is an empty string.- Specified by:
getDisplayNamein interfaceNodeInfo- Overrides:
getDisplayNamein classUnconstructedParent- Returns:
- The display name of this node. For a node with no name, return an empty string.
-
getPrefix
public java.lang.String getPrefix()
Get the prefix of the name of the node. This is defined only for elements and attributes. If the node has no prefix, or for other kinds of node, return a zero-length string.- Specified by:
getPrefixin interfaceNodeInfo- Overrides:
getPrefixin classUnconstructedParent- Returns:
- The prefix of the name of the node.
-
getBaseURI
public java.lang.String getBaseURI()
Description copied from class:UnconstructedParentGet the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node. This will be the same as the System ID unless xml:base has been used.- Specified by:
getBaseURIin interfaceNodeInfo- Overrides:
getBaseURIin classUnconstructedParent- Returns:
- the base URI of the node
-
getDocumentRoot
public DocumentInfo getDocumentRoot()
Get the root node, if it is a document node.- Specified by:
getDocumentRootin interfaceNodeInfo- Overrides:
getDocumentRootin classUnconstructedParent- Returns:
- the DocumentInfo representing the containing document. If this node is part of a tree that does not have a document node as its root, return null.
-
selectID
public NodeInfo selectID(java.lang.String id)
Get the element with a given ID, if any- Specified by:
selectIDin interfaceDocumentInfo- Parameters:
id- the required ID value- Returns:
- the element with the given ID, or null if there is no such ID present (or if the parser has not notified attributes as being of type ID)
- Since:
- 8.4
-
getUnparsedEntity
public java.lang.String[] getUnparsedEntity(java.lang.String name)
Get the unparsed entity with a given name- Specified by:
getUnparsedEntityin interfaceDocumentInfo- Parameters:
name- the name of the entity- Returns:
- if the entity exists, return an array of two Strings, the first holding the system ID of the entity, the second holding the public ID if there is one, or null if not. If the entity does not exist, the method returns null. Applications should be written on the assumption that this array may be extended in the future to provide additional information.
- Since:
- 8.4
-
-