com.icl.saxon.om
Interface ElementInfo

All Superinterfaces:
org.w3c.dom.Node, NodeInfo
All Known Implementing Classes:
ElementImpl, ElementWithAttributes, TinyElementImpl

public interface ElementInfo
extends NodeInfo

A node in the XML parse tree representing an XML element.

The ElementInfo provides information about the element and its context. Information available includes the tag and attributes of the element, and pointers to the parent element and the previous element at the same level.


Fields inherited from interface com.icl.saxon.om.NodeInfo
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NODE_TYPE_NAMES, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 void addNamespaceNodes(ElementInfo owner, java.util.Vector list, boolean addXML)
          Make the set of all namespace nodes associated with this element.
 ExtendedAttributes getAttributeList()
          Get the attribute list for this element.
 java.lang.String getPrefixForURI(java.lang.String uri)
          Search the NamespaceList for a given URI, returning the corresponding prefix.
 short getURICodeForPrefix(java.lang.String prefix)
          Search the NamespaceList for a given prefix, returning the corresponding URI code.
 AttributeInfo makeAttributeNode(int index)
          Make an attribute node for a given attribute of this element
 AttributeInfo makeAttributeNodeFS(int fingerprint)
          Make an attribute node for a given attribute of this element
 void outputNamespaceNodes(Outputter out, boolean includeAncestors)
          Output all namespace nodes associated with this element.
 
Methods inherited from interface com.icl.saxon.om.NodeInfo
copy, copyStringValue, defaultAction, enumerateChildren, getAllChildNodes, getAttributeValue, getAttributeValue, getAttributeValue, getDisplayName, getDocumentElement, getDocumentRoot, getFingerprint, getIndex, getLineNumber, getLocalName, getNameCode, getNextInDocument, getNodeName, getNodeType, getNumberOfChildren, getPath, getPrefix, getPreviousInDocument, getSequenceNumber, getSequentialKey, getSystemId, getURI, getURICode, getValue, isDocumentElement, isSameNode
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Method Detail

getAttributeList

public ExtendedAttributes getAttributeList()
Get the attribute list for this element.
Returns:
The attribute list (as in the SAX interface). If you are using the Distributor and you have not called setOptions(RETAIN_ATTRIBUTES) and this is not the startElement() call for the element, the attribute list will be null.

makeAttributeNode

public AttributeInfo makeAttributeNode(int index)
                                throws org.xml.sax.SAXException
Make an attribute node for a given attribute of this element
Parameters:
index - The relative position of the attribute, numbered from 0..n-1

makeAttributeNodeFS

public AttributeInfo makeAttributeNodeFS(int fingerprint)
                                  throws org.xml.sax.SAXException
Make an attribute node for a given attribute of this element
Parameters:
fingerprint - The fingerprint of the attribute name

getURICodeForPrefix

public short getURICodeForPrefix(java.lang.String prefix)
                          throws org.xml.sax.SAXException
Search the NamespaceList for a given prefix, returning the corresponding URI code.
Parameters:
prefix - The prefix to be matched. To find the default namespace, supply ""
Returns:
The URI code corresponding to this namespace. If it is an unnamed default namespace, return Namespace.NULL_CODE.
Throws:
org.xml.sax.SAXException - if the prefix has not been declared on this element or a containing element.

getPrefixForURI

public java.lang.String getPrefixForURI(java.lang.String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix.
Parameters:
uri - The URI to be matched. To find the default namespace, supply ""
Returns:
The prefix corresponding to this URI. If not found, return null.

addNamespaceNodes

public void addNamespaceNodes(ElementInfo owner,
                              java.util.Vector list,
                              boolean addXML)
                       throws org.xml.sax.SAXException
Make the set of all namespace nodes associated with this element.
Parameters:
owner - The element node to own these namespace nodes
list - a vector containing NamespaceInfo objects representing the namespaces in scope for this element; the method appends nodes to this Vector, which should initially be empty.
addXML - Add the XML namespace node to the list

outputNamespaceNodes

public void outputNamespaceNodes(Outputter out,
                                 boolean includeAncestors)
                          throws org.xml.sax.SAXException
Output all namespace nodes associated with this element.
Parameters:
out - The relevant outputter
includeAncestors - True if namespaces declared on ancestor elements must be output; false if it is known that these are already on the result tree