com.icl.saxon.tree
public class ElementImpl extends ParentNodeImpl implements Element
This class is an implementation of NodeInfo. For elements with attributes or namespace declarations, class ElementWithAttributes is used.
Field Summary | |
---|---|
protected int | nameCode |
protected DocumentImpl | root |
Constructor Summary | |
---|---|
ElementImpl()
Construct an empty ElementImpl |
Method Summary | |
---|---|
void | addNamespaceNodes(ElementImpl owner, Vector list, boolean addXML)
Make the set of all namespace nodes associated with this element. |
void | copy(Outputter out)
Copy this node to a given outputter (supporting xsl:copy-of) |
void | copy(Outputter out, boolean allNamespaces)
Copy this node to a given outputter (supporting xsl:copy-of) |
String | generateId()
Get a character string that uniquely identifies this node within this document
(The calling code will prepend a document identifier) |
AttributeCollection | getAttributeList()
Get the attribute list for this element. |
String | getAttributeValue(String name)
Find the value of a given attribute of this element. |
String | getBaseURI()
Get the base URI of this element node. |
DocumentInfo | getDocumentRoot()
Get the root node |
int | getLineNumber()
Get the line number of the node within its source document entity |
int | getNameCode()
Get the nameCode of the node. |
short | getNodeType()
Return the type of node. |
String | getPrefixForURI(String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix. |
String | getSystemId()
Get the system ID of the entity containing this element node. |
short | getURICodeForPrefix(String prefix)
Search the NamespaceList for a given prefix, returning the corresponding URI. |
void | initialise(int nameCode, AttributeCollection atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber)
Initialise a new ElementImpl with an element name |
int | makeNameCode(String qname, boolean useDefault)
Make a NameCode, using this Element as the context for namespace resolution.
|
void | outputNamespaceNodes(Outputter out, boolean includeAncestors)
Output all namespace nodes associated with this element. |
void | setAttribute(String name, String value)
Set the value of an attribute on the current element. |
void | setLineNumber(int line)
Set the line number of the element within its source document entity |
void | setNameCode(int nameCode)
Set the name code. |
void | setSystemId(String uri)
Set the system ID of this node. |
Parameters: owner The element owning these namespace nodes. list a Vector containing NamespaceImpl objects representing the namespaces in scope for this element; the method appends nodes to this Vector, which should initially be empty. Note that the returned list will never contain the XML namespace (to get this, the NamespaceEnumeration class adds it itself). The list WILL include an entry for the undeclaration xmlns=""; again it is the job of NamespaceEnumeration to ignore this, since it doesn't represent a true namespace node. addXML Add the XML namespace node to the list
Parameters: out The outputter allNamespaces true if namespaces for ancestor nodes must be output
Returns: a string.
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: name the name of an attribute. There must be no prefix in the name.
Returns: the value of the attribute, if it exists, otherwise null
Returns: NodeInfo.ELEMENT
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: name The element name, with namespaces resolved atts The attribute list: always null parent The parent node
Parameters: qname The name as written, in the form "[prefix:]localname"
UNKNOWN: useDefault Defines the action when there is no prefix. If true, use the default namespace URI (as for element names). If false, use no namespace URI (as for attribute names).
Parameters: out The relevant outputter
Throws: DOMException (always): the Saxon tree is immutable