|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.om.AbstractNode | +--com.icl.saxon.tree.NodeImpl | +--com.icl.saxon.tree.ParentNodeImpl | +--com.icl.saxon.tree.ElementImpl
ElementImpl implements an element with no attributes or namespace declarations.
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
|
Fields inherited from class com.icl.saxon.tree.ParentNodeImpl |
sequence |
Fields inherited from class com.icl.saxon.tree.NodeImpl |
emptyArray, index, parent |
Fields inherited from class com.icl.saxon.om.AbstractNode |
NODE_LETTER |
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 |
Fields inherited from interface com.icl.saxon.om.NodeInfo |
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT |
Constructor Summary | |
ElementImpl()
Construct an empty ElementImpl |
Method Summary | |
void |
addNamespaceNodes(ElementImpl owner,
java.util.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) |
java.lang.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. |
java.lang.String |
getAttributeValue(java.lang.String name)
Find the value of a given attribute of this element. |
java.lang.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. |
java.lang.String |
getPrefixForURI(java.lang.String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix. |
java.lang.String |
getSystemId()
Get the system ID of the entity containing this element node. |
short |
getURICodeForPrefix(java.lang.String prefix)
Search the NamespaceList for a given prefix, returning the corresponding URI. |
void |
initialise(int nameCode,
AttributeCollection atts,
NodeInfo parent,
java.lang.String baseURI,
int lineNumber,
int sequenceNumber)
Initialise a new ElementImpl with an element name |
int |
makeNameCode(java.lang.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(java.lang.String name,
java.lang.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(java.lang.String uri)
Set the system ID of this node. |
Methods inherited from class com.icl.saxon.tree.ParentNodeImpl |
addChild, compact, copyStringValue, dropChildren, enumerateChildren, getChildNodes, getFirstChild, getLastChild, getNodeValue, getNthChild, getSequenceNumber, getStringValue, hasChildNodes, removeChild, renumberChildren, useChildrenArray |
Methods inherited from class com.icl.saxon.tree.NodeImpl |
compareOrder, getAttributes, getAttributeValue, getAttributeValue, getDisplayName, getDocumentElement, getEnumeration, getFingerprint, getLocalName, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getURI, hasAttributes, isSameNode, removeNode |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface org.w3c.dom.Element |
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Field Detail |
protected int nameCode
protected DocumentImpl root
Constructor Detail |
public ElementImpl()
Method Detail |
public void setNameCode(int nameCode)
public void initialise(int nameCode, AttributeCollection atts, NodeInfo parent, java.lang.String baseURI, int lineNumber, int sequenceNumber)
name
- The element name, with namespaces resolvedatts
- The attribute list: always nullparent
- The parent nodepublic void setSystemId(java.lang.String uri)
setSystemId
in class NodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in class NodeImpl
com.icl.saxon.tree.NodeImpl
public final java.lang.String getSystemId()
getSystemId
in class NodeImpl
com.icl.saxon.om.NodeInfo
public java.lang.String getBaseURI()
getBaseURI
in class NodeImpl
public void setLineNumber(int line)
public int getLineNumber()
getLineNumber
in class NodeImpl
com.icl.saxon.om.NodeInfo
public int getNameCode()
getNameCode
in class NodeImpl
com.icl.saxon.om.NodeInfo
allocate
,
getFingerprint
public java.lang.String generateId()
generateId
in class NodeImpl
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 final int makeNameCode(java.lang.String qname, boolean useDefault) throws NamespaceException
qname
- The name as written, in the form "[prefix:]localname"public void addNamespaceNodes(ElementImpl owner, java.util.Vector list, boolean addXML)
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 listpublic void outputNamespaceNodes(Outputter out, boolean includeAncestors) throws javax.xml.transform.TransformerException
outputNamespaceNodes
in class NodeImpl
out
- The relevant outputterpublic final short getNodeType()
getNodeType
in interface org.w3c.dom.Node
public AttributeCollection getAttributeList()
public java.lang.String getAttributeValue(java.lang.String name)
name
- the name of an attribute. There must be no prefix in the name.public void setAttribute(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
setAttribute
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
- (always): the Saxon tree is immutablepublic void copy(Outputter out) throws javax.xml.transform.TransformerException
public void copy(Outputter out, boolean allNamespaces) throws javax.xml.transform.TransformerException
out
- The outputterallNamespaces
- true if namespaces for ancestor nodes must be output
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |