| java.lang.Object net.sf.saxon.tree.NodeImpl net.sf.saxon.tree.ParentNodeImpl net.sf.saxon.tree.ElementImpl net.sf.saxon.tree.ElementWithAttributes
All known Subclasses: net.sf.saxon.style.StyleElement, net.sf.saxon.style.DataElement,
ElementWithAttributes | public class ElementWithAttributes extends ElementImpl (Code) | | A node in the XML parse tree representing an XML element.
This class is an implementation of NodeInfo
author: Michael H. Kay version: 8 August 2000: separated from ElementImpl |
Method Summary | |
public void | copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) | public AttributeCollection | getAttributeList() Get the attribute list for this element.
The attribute list. | public String | getAttributeValue(int fingerprint) | public int[] | getDeclaredNamespaces(int[] buffer) Get all namespace undeclarations and undeclarations defined on this element.
Parameters: buffer - If this is non-null, and the result array fits in this buffer, then the resultmay overwrite the contents of this array, to avoid the cost of allocating a new array on the heap. | public int[] | getInScopeNamespaceCodes() Get the list of in-scope namespaces for this element as an array of
namespace codes. | public String | getPrefixForURI(String uri) Search the NamespaceList for a given URI, returning the corresponding prefix.
Parameters: uri - The URI to be matched. | public short | getURICodeForPrefix(String prefix) Search the NamespaceList for a given prefix, returning the corresponding URI.
Parameters: prefix - The prefix to be matched. | public String | getURIForPrefix(String prefix, boolean useDefault) Get the namespace URI corresponding to a given prefix. | public void | initialise(int nameCode, AttributeCollectionImpl atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber) | public Iterator | iteratePrefixes() Get an iterator over all the prefixes declared in this namespace context. | public void | sendNamespaceDeclarations(Receiver out, boolean includeAncestors) Output all namespace nodes associated with this element. | public void | setNamespaceDeclarations(int[] namespaces, int namespacesUsed) |
namespaceList | protected int[] namespaceList(Code) | | |
copy | public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException(Code) | | Copy this node to a given outputter (supporting xsl:copy-of)
Parameters: out - The outputter Parameters: whichNamespaces - indicates which namespaces should be output: all, none, or localnamespaces only (those not declared on the parent element) |
getAttributeList | public AttributeCollection getAttributeList()(Code) | | Get the attribute list for this element.
The attribute list. This will not include anynamespace attributes. The attribute names will be in expanded form, with prefixesreplaced by URIs |
getAttributeValue | public String getAttributeValue(int fingerprint)(Code) | | Get the value of a given attribute of this node
Parameters: fingerprint - The fingerprint of the attribute name the attribute value if it exists or null if not |
getDeclaredNamespaces | public int[] getDeclaredNamespaces(int[] buffer)(Code) | | Get all namespace undeclarations and undeclarations defined on this element.
Parameters: buffer - If this is non-null, and the result array fits in this buffer, then the resultmay overwrite the contents of this array, to avoid the cost of allocating a new array on the heap. An array of integers representing the namespace declarations and undeclarations present onthis element. For a node other than an element, return null. Otherwise, the returned array is asequence of namespace codes, whose meaning may be interpreted by reference to the name pool. Thetop half word of each namespace code represents the prefix, the bottom half represents the URI.If the bottom half is zero, then this is a namespace undeclaration rather than a declaration.The XML namespace is never included in the list. If the supplied array is larger than required,then the first unused entry will be set to -1.For a node other than an element, the method returns null. |
getInScopeNamespaceCodes | public int[] getInScopeNamespaceCodes()(Code) | | Get the list of in-scope namespaces for this element as an array of
namespace codes. (Used by LiteralResultElement)
|
getPrefixForURI | public String getPrefixForURI(String uri)(Code) | | Search the NamespaceList for a given URI, returning the corresponding prefix.
Parameters: uri - The URI to be matched. The prefix corresponding to this URI. If not found, return null. If there ismore than one prefix matching the URI, the first one found is returned. If the URI matchesthe default namespace, return an empty string. |
getURICodeForPrefix | public short getURICodeForPrefix(String prefix) throws NamespaceException(Code) | | Search the NamespaceList for a given prefix, returning the corresponding URI.
Parameters: prefix - The prefix to be matched. To find the default namespace, supply "" The URI code corresponding to this namespace. If it is an unnamed default namespace,return Namespace.NULL_CODE. throws: NamespaceException - if the prefix has not been declared on this NamespaceList. |
getURIForPrefix | public String getURIForPrefix(String prefix, boolean useDefault)(Code) | | Get the namespace URI corresponding to a given prefix. Return null
if the prefix is not in scope.
Parameters: prefix - the namespace prefix. May be the zero-length string, indicatingthat there is no prefix. This indicates either the default namespace or thenull namespace, depending on the value of useDefault. Parameters: useDefault - true if the default namespace is to be used when theprefix is "". If false, the method returns "" when the prefix is "". the uri for the namespace, or null if the prefix is not in scope.The "null namespace" is represented by the pseudo-URI "". |
initialise | public void initialise(int nameCode, AttributeCollectionImpl atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber)(Code) | | Initialise a new ElementWithAttributes with an element name and attribute list
Parameters: nameCode - The element name, with namespaces resolved Parameters: atts - The attribute list, after namespace processing Parameters: parent - The parent node |
iteratePrefixes | public Iterator iteratePrefixes()(Code) | | Get an iterator over all the prefixes declared in this namespace context. This will include
the default namespace (prefix="") and the XML namespace where appropriate
|
sendNamespaceDeclarations | public void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException(Code) | | Output all namespace nodes associated with this element.
Parameters: out - The relevant outputter |
setNamespaceDeclarations | public void setNamespaceDeclarations(int[] namespaces, int namespacesUsed)(Code) | | Set the namespace declarations for the element
|
Fields inherited from net.sf.saxon.tree.ParentNodeImpl | protected int sequence(Code)(Java Doc)
|
|
|