net.sf.saxon.tree
public class ElementWithAttributes extends ElementImpl
This class is an implementation of NodeInfo
Version: 8 August 2000: separated from ElementImpl
Field Summary | |
---|---|
protected AttributeCollection | attributeList |
protected int[] | namespaceList |
Method Summary | |
---|---|
void | copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter (supporting xsl:copy-of) |
AttributeCollection | getAttributeList()
Get the attribute list for this element. |
String | getAttributeValue(int fingerprint)
Get the value of a given attribute of this node |
int[] | getDeclaredNamespaces(int[] buffer)
Get all namespace undeclarations and undeclarations defined on this element.
|
int[] | getInScopeNamespaceCodes()
Get the list of in-scope namespaces for this element as an array of
namespace codes. |
String | getPrefixForURI(String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix. |
short | getURICodeForPrefix(String prefix)
Search the NamespaceList for a given prefix, returning the corresponding URI. |
String | getURIForPrefix(String prefix, boolean useDefault)
Get the namespace URI corresponding to a given prefix. |
void | initialise(int nameCode, AttributeCollectionImpl atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber)
Initialise a new ElementWithAttributes with an element name and attribute list |
Iterator | iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context. |
void | sendNamespaceDeclarations(Receiver out, boolean includeAncestors)
Output all namespace nodes associated with this element. |
void | setNamespaceDeclarations(int[] namespaces, int namespacesUsed)
Set the namespace declarations for the element |
Parameters: out The outputter whichNamespaces indicates which namespaces should be output: all, none, or local namespaces only (those not declared on the parent element)
Returns: The attribute list. This will not include any namespace attributes. The attribute names will be in expanded form, with prefixes replaced by URIs
Parameters: fingerprint The fingerprint of the attribute name
Returns: the attribute value if it exists or null if not
Parameters: buffer If this is non-null, and the result array fits in this buffer, then the result may overwrite the contents of this array, to avoid the cost of allocating a new array on the heap.
Returns: An array of integers representing the namespace declarations and undeclarations present on
this element. For a node other than an element, return null. Otherwise, the returned array is a
sequence of namespace codes, whose meaning may be interpreted by reference to the name pool. The
top 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.
Parameters: uri The URI to be matched.
Returns: The prefix corresponding to this URI. If not found, return null. If there is more than one prefix matching the URI, the first one found is returned. If the URI matches the default namespace, return an empty string.
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: NamespaceException if the prefix has not been declared on this NamespaceList.
Parameters: prefix the namespace prefix. May be the zero-length string, indicating that there is no prefix. This indicates either the default namespace or the null namespace, depending on the value of useDefault. useDefault true if the default namespace is to be used when the prefix is "". If false, the method returns "" when the prefix is "".
Returns: the uri for the namespace, or null if the prefix is not in scope. The "null namespace" is represented by the pseudo-URI "".
Parameters: nameCode The element name, with namespaces resolved atts The attribute list, after namespace processing parent The parent node
Parameters: out The relevant outputter