Class TinyAttributeImpl
java.lang.Object
com.icl.saxon.om.AbstractNode
com.icl.saxon.tinytree.TinyNodeImpl
com.icl.saxon.tinytree.TinyAttributeImpl
- All Implemented Interfaces:
NodeInfo, DOMLocator, Source, SourceLocator, Attr, Node
A node in the XML parse tree representing an attribute. Note that this is
generated only "on demand", when the attribute is selected by a select pattern.
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class TinyNodeImpl
document, nodeNr, parentFields inherited from class AbstractNode
NODE_LETTERFields inherited from interface Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy this node to a given outputterGenerate id.Get the display name of this node.intGet the fingerprint of the node, used for matching namesintGet the line number of the node within its source document entityGet the local name of this node.intGet the name code of the node, used for finding names in the name poolfinal shortReturn the type of node.Get the parent nodeGet the prefix part of the name of this node.The type information associated with this attribute.protected longGet the node sequence number (in document order).Return the character value of the node.final StringgetURI()Get the URI part of the name of this node.booleanisId()Returns whether this attribute is known to be of type ID (i.e.Methods inherited from class TinyNodeImpl
compareOrder, getAttributeValue, getAttributeValue, getBaseURI, getDocumentRoot, getEnumeration, getOriginatingNode, getSystemId, hasAttributes, hasChildNodes, isSameNodeInfo, outputNamespaceNodes, setLineNumber, setParentNode, setSystemIdMethods inherited from class AbstractNode
appendChild, appendData, cloneNode, compareDocumentPosition, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildNodes, getColumnNumber, getData, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getFirstChild, getImplementation, getLastChild, getLength, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getOwnerElement, getParentNode, getPreviousSibling, getPublicId, getSpecified, getTagName, getTextContent, getUserData, getValue, getWholeText, hasAttribute, hasAttributeNS, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, replaceWholeText, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supportsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Attr
getName, getOwnerElement, getSpecified, getValue, setValueMethods inherited from interface Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
TinyAttributeImpl
-
-
Method Details
-
getParent
Get the parent node- Specified by:
getParentin interfaceNodeInfo- Overrides:
getParentin classTinyNodeImpl- Returns:
- The Node object describing the containing element or root node.
-
getSequenceNumber
protected long getSequenceNumber()Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive. In the current implementation, parent nodes (elements and roots) have a zero least-significant word, while namespaces, attributes, text nodes, comments, and PIs have the top word the same as their owner and the bottom half reflecting their relative position.- Overrides:
getSequenceNumberin classTinyNodeImpl
-
getNodeType
public final short getNodeType()Return the type of node.- Specified by:
getNodeTypein interfaceNode- Specified by:
getNodeTypein interfaceNodeInfo- Returns:
- Node.ATTRIBUTE
-
getStringValue
Return the character value of the node.- Specified by:
getStringValuein interfaceNodeInfo- Returns:
- the attribute value
-
getFingerprint
public int getFingerprint()Get the fingerprint of the node, used for matching names- Specified by:
getFingerprintin interfaceNodeInfo- Overrides:
getFingerprintin classTinyNodeImpl
-
getNameCode
public int getNameCode()Get the name code of the node, used for finding names in the name pool- Specified by:
getNameCodein interfaceNodeInfo- Overrides:
getNameCodein classTinyNodeImpl- See Also:
-
getPrefix
Get the prefix part of the name of this node. This is the name before the ":" if any. -
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 classTinyNodeImpl- Returns:
- The display name of this node. For a node with no name, return an empty string.
-
getLocalName
Get the local name of this node.- Specified by:
getLocalNamein interfaceNode- Specified by:
getLocalNamein interfaceNodeInfo- Overrides:
getLocalNamein classTinyNodeImpl- Returns:
- The local name of this node. For a node with no name, return an empty string.
-
getURI
Get the URI part of the name of this node.- Specified by:
getURIin interfaceNodeInfo- Overrides:
getURIin classTinyNodeImpl- Returns:
- The URI of the namespace of this node. For the default namespace, return an empty string
-
generateId
Generate id. Returns key of owning element with the attribute name as a suffix- Specified by:
generateIdin interfaceNodeInfo- Overrides:
generateIdin classTinyNodeImpl- Returns:
- a string.
-
copy
Copy this node to a given outputter- Specified by:
copyin interfaceNodeInfo- Throws:
TransformerException
-
getLineNumber
public int getLineNumber()Get the line number of the node within its source document entity- Specified by:
getLineNumberin interfaceNodeInfo- Specified by:
getLineNumberin interfaceSourceLocator- Overrides:
getLineNumberin classTinyNodeImpl- Returns:
- the line number of the node in its original source document; or -1 if not available
-
getSchemaTypeInfo
The type information associated with this attribute. While the type information contained in this attribute is guarantee to be correct after loading the document or invokingDocument.normalizeDocument(),schemaTypeInfomay not be reliable if the node was moved.- Specified by:
getSchemaTypeInfoin interfaceAttr- Overrides:
getSchemaTypeInfoin classAbstractNode- Since:
- DOM Level 3
-
isId
public boolean isId()Returns whether this attribute is known to be of type ID (i.e. to contain an identifier for its owner element) or not. When it is and its value is unique, theownerElementof this attribute can be retrieved using the methodDocument.getElementById. The implementation could use several ways to determine if an attribute node is known to contain an identifier:- If validation
occurred using an XML Schema [XML Schema Part 1]
while loading the document or while invoking
Document.normalizeDocument(), the post-schema-validation infoset contributions (PSVI contributions) values are used to determine if this attribute is a schema-determined ID attribute using the schema-determined ID definition in [XPointer] . - If validation occurred using a DTD while loading the document or
while invoking
Document.normalizeDocument(), the infoset [type definition] value is used to determine if this attribute is a DTD-determined ID attribute using the DTD-determined ID definition in [XPointer] . - from the use of the methods
Element.setIdAttribute(),Element.setIdAttributeNS(), orElement.setIdAttributeNode(), i.e. it is an user-determined ID attribute;Note: XPointer framework (see section 3.2 in [XPointer] ) consider the DOM user-determined ID attribute as being part of the XPointer externally-determined ID definition.
- using mechanisms that are outside the scope of this specification, it is then an externally-determined ID attribute. This includes using schema languages different from XML schema and DTD.
If validation occurred while invokingDocument.normalizeDocument(), all user-determined ID attributes are reset and all attribute nodes ID information are then reevaluated in accordance to the schema used. As a consequence, if theAttr.schemaTypeInfoattribute contains an ID type,isIdwill always return true.- Specified by:
isIdin interfaceAttr- Overrides:
isIdin classAbstractNode- Since:
- DOM Level 3
- If validation
occurred using an XML Schema [XML Schema Part 1]
while loading the document or while invoking
-