net.sf.saxon.evpull.StartElementEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of saxon9 Show documentation
Show all versions of saxon9 Show documentation
Provides a basic XSLT 2.0 and XQuery 1.0 processor (W3C Recommendations,
January 2007). Command line interfaces and implementations of several
Java APIs (DOM, XPath, s9api) are also included.
The newest version!
package net.sf.saxon.evpull;
import net.sf.saxon.Configuration;
import net.sf.saxon.Err;
import net.sf.saxon.sort.IntArraySet;
import net.sf.saxon.om.NamePool;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.Orphan;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.type.Type;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* 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.
*/
public class StartElementEvent implements PullEvent {
private Configuration config;
private int nameCode;
private int typeCode;
private int[] localNamespaces;
private List attributes;
/**
* Create a Start Element Event
* @param config the configuration
*/
public StartElementEvent(Configuration config) {
this.config = config;
}
/**
* Set the nameCode of this element
* @param nameCode the namecode of the element (its name as identified in the NamePool)
*/
public void setNameCode(int nameCode) {
this.nameCode = nameCode;
}
/**
* Get the nameCode of this element
* @return the nameCode representing the element's name
*/
public int getNameCode() {
return nameCode;
}
/**
* Set the typeCode of this element
* @param typeCode the name pool fingerprint of the element's type annotation
*/
public void setTypeCode(int typeCode) {
this.typeCode = typeCode;
}
/**
* Get the typeCode of this element
* @return the name pool fingerprint of the element's type annotation
*/
public int getTypeCode() {
return typeCode;
}
/**
* Set the namespaces that are locally declared (or undeclared) on this element
* @param nscodes integer array of namespace codes
*/
public void setLocalNamespaces(int[] nscodes) {
localNamespaces = nscodes;
}
/**
* Add a namespace code representing a locally declared namespace
* @param nscode a namespace code
* @throws XPathException
*/
public void addNamespace(int nscode) throws XPathException {
if (localNamespaces == null) {
localNamespaces = new int[]{nscode, -1, -1, -1};
}
for (int n=0; n
© 2015 - 2025 Weber Informatics LLC | Privacy Policy