net.sf.saxon.pull
Class UnconstructedDocument
- DocumentInfo, Item, NodeInfo, Source, NodeInfo, PullEvent, ValueRepresentation
public class UnconstructedDocument
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
atomize , compareOrder , copy , equals , generateId , getAttributeValue , getBaseURI , getConfiguration , getDeclaredNamespaces , getDisplayName , getDocumentNumber , getDocumentRoot , getFingerprint , getInstruction , getLineNumber , getLocalPart , getNamePool , getParent , getPrefix , getPuller , getRoot , getStringValue , getStringValueCS , getSystemId , getTypeAnnotation , getTypedValue , getURI , getXPathContext , hasChildNodes , hashCode , isSameNodeInfo , iterateAxis , iterateAxis , setSystemId |
UnconstructedDocument
public UnconstructedDocument(DocumentInstr instruction,
XPathContext context)
Create an unconstructed (pending) document node
instruction
- the instruction responsible for creating the nodecontext
- the XPath dynamic context
getDisplayName
public 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.
- getDisplayName in interface NodeInfo
- getDisplayName in interface UnconstructedParent
- The display name of this node. For a node with no name, return
an empty string.
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.
- getFingerprint in interface NodeInfo
- getFingerprint in interface UnconstructedParent
- an integer fingerprint; two nodes with the same fingerprint have
the same expanded QName
getLocalPart
public String getLocalPart()
Get the local part of the name of this node. This is the name after the ":" if any.
- getLocalPart in interface NodeInfo
- getLocalPart in interface UnconstructedParent
- 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.
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.
- getNameCode in interface NodeInfo
- an integer name code, which may be used to obtain the actual node
name from the name pool
getNodeKind
public int getNodeKind()
Get the kind of node. This will be a value such as
Type.ELEMENT
or
Type.ATTRIBUTE
. There are seven kinds of node: documents, elements, attributes,
text, comments, processing-instructions, and namespaces.
- getNodeKind in interface NodeInfo
- an integer identifying the kind of node. These integer values are the
same as those used in the DOM
getPrefix
public 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.
- getPrefix in interface NodeInfo
- getPrefix in interface UnconstructedParent
- The prefix of the name of the node.
getURI
public 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.
- getURI in interface NodeInfo
- getURI in interface UnconstructedParent
- The URI of the namespace of this node. For an unnamed node,
or for a node with an empty prefix, return an empty
string.
getUnparsedEntity
public String[] getUnparsedEntity(String name)
Get the unparsed entity with a given name
- getUnparsedEntity in interface DocumentInfo
name
- the name of the entity
- 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.
selectID
public NodeInfo selectID(String id)
Get the element with a given ID, if any
- selectID in interface DocumentInfo
id
- the required ID value
- 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)