|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.tree.NodeImpl
net.sf.saxon.tree.ParentNodeImpl
net.sf.saxon.tree.ElementImpl
net.sf.saxon.tree.ElementWithAttributes
A node in the XML parse tree representing an XML element.
This class is an implementation of NodeInfo
Field Summary | |
protected AttributeCollection |
attributeList
|
protected int[] |
namespaceList
|
Fields inherited from class net.sf.saxon.tree.ElementImpl |
nameCode, root, sequence |
Fields inherited from class net.sf.saxon.tree.NodeImpl |
index, NODE_LETTER, parent |
Fields inherited from interface net.sf.saxon.om.NodeInfo |
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, LOCAL_NAMESPACES, NO_NAMESPACES |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
EMPTY_VALUE_ARRAY |
Constructor Summary | |
ElementWithAttributes()
|
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. |
java.lang.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. |
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. |
java.lang.String |
getURIForPrefix(java.lang.String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix. |
void |
initialise(int nameCode,
AttributeCollectionImpl atts,
NodeInfo parent,
java.lang.String baseURI,
int lineNumber,
int sequenceNumber)
Initialise a new ElementWithAttributes with an element name and attribute list |
java.util.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 |
Methods inherited from class net.sf.saxon.tree.ElementImpl |
addChild, compact, enumerateChildren, generateId, getBaseURI, getDocumentRoot, getFirstChild, getLastChild, getLineNumber, getNameCode, getNodeKind, getNthChild, getRoot, getSequenceNumber, getStringValue, getStringValueCS, getSystemId, hasChildNodes, setLineNumber, setNameCode, setSystemId, useChildrenArray |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
atomize, compareOrder, equals, getColumnNumber, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getTypeAnnotation, getTypedValue, getURI, hashCode, isSameNodeInfo, iterateAxis, iterateAxis |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AttributeCollection attributeList
protected int[] namespaceList
Constructor Detail |
public ElementWithAttributes()
Method Detail |
public void initialise(int nameCode, AttributeCollectionImpl atts, NodeInfo parent, java.lang.String baseURI, int lineNumber, int sequenceNumber)
initialise
in class ElementImpl
nameCode
- The element name, with namespaces resolvedatts
- The attribute list, after namespace processingparent
- The parent nodebaseURI
- The base URI of the new elementlineNumber
- The line number of the element in the source documentsequenceNumber
- Integer identifying this element within the documentpublic void setNamespaceDeclarations(int[] namespaces, int namespacesUsed)
public java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault)
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 "".
public java.util.Iterator iteratePrefixes()
public short getURICodeForPrefix(java.lang.String prefix) throws NamespaceException
prefix
- The prefix to be matched. To find the default namespace, supply ""
NamespaceException
- if the prefix has not been declared on this NamespaceList.public java.lang.String getPrefixForURI(java.lang.String uri)
uri
- The URI to be matched.
public void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException
sendNamespaceDeclarations
in interface NodeInfo
sendNamespaceDeclarations
in class ElementImpl
out
- The relevant outputter
XPathException
public int[] getDeclaredNamespaces(int[] buffer)
getDeclaredNamespaces
in interface NodeInfo
getDeclaredNamespaces
in class ElementImpl
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.
For a node other than an element, the method returns null.
public int[] getInScopeNamespaceCodes()
public AttributeCollection getAttributeList()
getAttributeList
in class ElementImpl
public java.lang.String getAttributeValue(int fingerprint)
getAttributeValue
in interface NodeInfo
getAttributeValue
in class NodeImpl
fingerprint
- The fingerprint of the attribute name
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException
copy
in interface NodeInfo
copy
in class ElementImpl
out
- The outputterwhichNamespaces
- indicates which namespaces should be output: all, none, or local
namespaces only (those not declared on the parent element)
XPathException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |