net.sf.saxon.evpull
Class StartElementEvent
java.lang.Object
net.sf.saxon.evpull.StartElementEvent
- PullEvent
public class StartElementEvent
extends java.lang.Object
This is a PullEvent representing the start of an element node. It contains (or potentially contains) all the
namespace nodes and attribute nodes associated with the element.
StartElementEvent
public StartElementEvent(Configuration config)
Create a Start Element Event
config
- the configuration
addAttribute
public void addAttribute(NodeInfo att)
throws XPathException
Add an attribute to the element node
att
- the attribute to be added
XPathException
- in the event of a dynamic error, for example a duplicate attribute in XQuery
addNamespace
public void addNamespace(int nscode)
throws XPathException
Add a namespace code representing a locally declared namespace
nscode
- a namespace code
getLocalNamespaces
public int[] getLocalNamespaces()
Get the namespaces locally declared on this element
- an array of namespace codes
getNameCode
public int getNameCode()
Get the nameCode of this element
- the nameCode representing the element's name
getTypeCode
public int getTypeCode()
Get the typeCode of this element
- the name pool fingerprint of the element's type annotation
hasAttributes
public boolean hasAttributes()
Ask whether the element has any attributes
- true if the element has one or more attributes
iterateAttributes
public Iterator iterateAttributes()
Get an iterator over the attributes of this element
- an iterator which delivers NodeInfo objects representing the attributes of this element
namespaceFixup
public void namespaceFixup()
Perform namespace fixup. This is done after all the attributes and explicit namespaces have been added.
Namespace fixup ensures that a namespace declaration is present for the element name and for every
attribute name, and that the prefixes of the element and each attribute are consistent with the declared
namespaces, changing any prefixes in the event of a conflict.
setLocalNamespaces
public void setLocalNamespaces(int[] nscodes)
Set the namespaces that are locally declared (or undeclared) on this element
nscodes
- integer array of namespace codes
setNameCode
public void setNameCode(int nameCode)
Set the nameCode of this element
nameCode
- the namecode of the element (its name as identified in the NamePool)
setTypeCode
public void setTypeCode(int typeCode)
Set the typeCode of this element
typeCode
- the name pool fingerprint of the element's type annotation