org.apache.xalan.xsltc.compiler
Class SyntaxTreeNode

java.lang.Object
  extended by org.apache.xalan.xsltc.compiler.SyntaxTreeNode
All Implemented Interfaces:
Constants
Direct Known Subclasses:
Expression, Instruction, Stylesheet, TopLevelElement, UnsupportedElement

public abstract class SyntaxTreeNode
extends java.lang.Object
implements Constants


Field Summary
protected  AttributeList _attributes
           
private  java.util.Vector _contents
           
private  int _line
           
private  int _nodeIDForStylesheetNSLookup
           
protected  SyntaxTreeNode _parent
           
private  Parser _parser
           
private  java.util.Hashtable _prefixMapping
           
protected  QName _qname
           
private static char[] _spaces
           
private  Stylesheet _stylesheet
           
private  Template _template
           
(package private) static SyntaxTreeNode Dummy
           
protected static int IndentIncrement
           
static int UNKNOWN_STYLESHEET_NODE_ID
           
 
Fields inherited from interface org.apache.xalan.xsltc.compiler.Constants
ABSOLUTE_ITERATOR, ACC_FINAL, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_SUPER, ADD_ATTRIBUTE, ADD_ATTRIBUTE_SIG, ADD_ITERATOR, ADD_ITERATOR_SIG, ADD_PARAMETER, ADD_PARAMETER_SIG, APPLY_TEMPLATES, ATTR_SET_SIG, ATTRIBUTE_LIST_FIELD, ATTRIBUTE_LIST_IMPL_CLASS, ATTRIBUTE_LIST_IMPL_SIG, ATTRIBUTES_SIG, BASIS_LIBRARY_CLASS, BOOLEAN_CLASS, BOOLEAN_VALUE, BOOLEAN_VALUE_SIG, CACHED_NODE_LIST_ITERATOR_CLASS, CHARACTERS, CHARACTERS_SIG, CHARACTERSW, CHARACTERSW_SIG, CLEAR_ATTRIBUTES, CLEAR_ATTRIBUTES_SIG, COLLATOR_CLASS, COLLATOR_SIG, COMPILER_PACKAGE, CURRENT_NODE_LIST_FILTER, CURRENT_NODE_LIST_FILTER_SIG, CURRENT_NODE_LIST_ITERATOR, CURRENT_NODE_LIST_ITERATOR_SIG, DEFAULT_NODE_COUNTER, DEFAULT_NODE_COUNTER_SIG, DOCUMENT_PNAME, DOM_ADAPTER_CLASS, DOM_ADAPTER_SIG, DOM_FIELD, DOM_IMPL, DOM_IMPL_CLASS, DOM_IMPL_SIG, DOM_INTF, DOM_INTF_SIG, DOM_PNAME, DOUBLE_CLASS, DOUBLE_SIG, DOUBLE_VALUE, DOUBLE_VALUE_SIG, DUP_FILTERED_ITERATOR, EMPTYATTR_FIELD, EMPTYSTRING, ERROR, EXPAND_STYLESHEET_QNAME_REF, EXPAND_STYLESHEET_QNAME_SIG, FALLBACK_CLASS, FATAL, FILTER_INTERFACE, FILTER_INTERFACE_SIG, FILTER_ITERATOR, FILTER_STEP_ITERATOR, FORMAT_SYMBOLS_FIELD, GET_ATTRIBUTE_VALUE, GET_ATTRIBUTE_VALUE_SIG, GET_CHILDREN, GET_CHILDREN_SIG, GET_ELEMENT_VALUE, GET_ELEMENT_VALUE_SIG, GET_ITERATOR_SIG, GET_NODE_NAME, GET_NODE_NAME_SIG, GET_NODE_TYPE, GET_NODE_TYPE_SIG, GET_NODE_VALUE, GET_NODE_VALUE_ITERATOR, GET_NODE_VALUE_ITERATOR_SIG, GET_NODE_VALUE_SIG, GET_PARAMETER, GET_PARAMETER_SIG, GET_PARENT, GET_PARENT_SIG, GET_TYPED_CHILDREN, GET_TYPED_CHILDREN_SIG, GET_UNPARSED_ENTITY_URI, GET_UNPARSED_ENTITY_URI_SIG, HAS_ATTRIBUTE, HAS_ATTRIBUTE_SIG, HASIDCALL_INDEX, HASIDCALL_INDEX_SIG, INT_VALUE, INT_VALUE_SIG, INTEGER_CLASS, INTEGER_SIG, INTERNAL, INVOKE_METHOD, ITERATOR_FIELD_SIG, ITERATOR_PNAME, KEY_INDEX_CLASS, KEY_INDEX_ITERATOR_SIG, KEY_INDEX_SIG, LAST_INDEX, LOAD_DOCUMENT_CLASS, LOCALE_CLASS, LOCALE_SIG, LOOKUP_STYLESHEET_QNAME_NS_REF, LOOKUP_STYLESHEET_QNAME_NS_SIG, MAKE_NODE, MAKE_NODE_LIST, MAKE_NODE_LIST_SIG, MAKE_NODE_LIST_SIG2, MAKE_NODE_SIG, MAKE_NODE_SIG2, MATCHING_ITERATOR, MATH_CLASS, MULTI_DOM_CLASS, MULTI_DOM_SIG, NAMES_INDEX, NAMES_INDEX_SIG, NAMESPACE_FEATURE, NAMESPACE_INDEX, NAMESPACE_INDEX_SIG, NEXT, NEXT_SIG, NEXTID, NODE, NODE_COUNTER, NODE_COUNTER_SIG, NODE_FIELD, NODE_FIELD_SIG, NODE_ITERATOR, NODE_ITERATOR_BASE, NODE_ITERATOR_SIG, NODE_PNAME, NODE_SIG, NODE_SORT_FACTORY, NODE_SORT_FACTORY_SIG, NODE_SORT_RECORD, NODE_SORT_RECORD_SIG, NS_ANCESTORS_INDEX_SIG, NTH_ITERATOR_CLASS, OBJECT_CLASS, OBJECT_SIG, ORDER_ITERATOR, ORDER_ITERATOR_SIG, OUTPUT_BASE, OUTPUT_HANDLER, OUTPUT_HANDLER_SIG, POP_PARAM_FRAME, POP_PARAM_FRAME_SIG, POSITION_INDEX, PREFIX_URIS_ARRAY_SIG, PREFIX_URIS_IDX_SIG, PUSH_PARAM_FRAME, PUSH_PARAM_FRAME_SIG, REDIRECT_URI, RESET, RESET_SIG, RTF_INITIAL_SIZE, RUNTIME_NODE_CLASS, RUNTIME_PACKAGE, SAX_IMPL, SAX_IMPL_CLASS, SAX_IMPL_SIG, SET_START_NODE, SET_START_NODE_SIG, SINGLETON_ITERATOR, SORT_ITERATOR, SORT_ITERATOR_SIG, STATIC_CHAR_DATA_FIELD, STATIC_CHAR_DATA_FIELD_SIG, STATIC_NAMES_ARRAY_FIELD, STATIC_NAMESPACE_ARRAY_FIELD, STATIC_NS_ANCESTORS_ARRAY_FIELD, STATIC_PREFIX_URIS_ARRAY_FIELD, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD, STATIC_TYPES_ARRAY_FIELD, STATIC_URIS_ARRAY_FIELD, STEP_ITERATOR_CLASS, STREAM_XML_OUTPUT, STRING, STRING_BUFFER_CLASS, STRING_BUFFER_SIG, STRING_CLASS, STRING_SIG, STRING_TO_INT, STRING_TO_INT_SIG, STRING_TO_REAL, STRING_TO_REAL_SIG, STRING_VALUE_HANDLER, STRING_VALUE_HANDLER_SIG, STRING_WRITER, STRIP_SPACE, STRIP_SPACE_INTF, STRIP_SPACE_PARAMS, STRIP_SPACE_SIG, TRANSLET_CLASS, TRANSLET_FIELD, TRANSLET_FIELD_SIG, TRANSLET_INTF, TRANSLET_INTF_SIG, TRANSLET_OUTPUT_BASE, TRANSLET_OUTPUT_INTERFACE, TRANSLET_OUTPUT_PNAME, TRANSLET_OUTPUT_SIG, TRANSLET_PNAME, TRANSLET_SIG, TRANSLET_URI, TRANSLET_VERSION_INDEX, TRANSLET_VERSION_INDEX_SIG, TYPES_INDEX, TYPES_INDEX_SIG, UNION_ITERATOR_CLASS, UNION_ITERATOR_SIG, UNSUPPORTED, URIS_INDEX, URIS_INDEX_SIG, WARNING, WRITER_SIG, XHTML_URI, XMLNS_PREFIX, XMLNS_STRING, XMLNS_URI, XSLT_PACKAGE, XSLT_URI
 
Constructor Summary
SyntaxTreeNode()
          Creates a new SyntaxTreeNode with a 'null' QName and no source file line number reference.
SyntaxTreeNode(int line)
          Creates a new SyntaxTreeNode with a 'null' QName.
SyntaxTreeNode(java.lang.String uri, java.lang.String prefix, java.lang.String local)
          Creates a new SyntaxTreeNode with no source file line number reference.
 
Method Summary
protected  void addAttribute(java.lang.String qname, java.lang.String value)
           
protected  void addElement(SyntaxTreeNode element)
          Adds a child node to this syntax tree node.
protected  void addPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Adds a single prefix mapping to this syntax tree node.
protected  void compileResultTree(ClassGenerator classGen, MethodGenerator methodGen)
          Utility method used by parameters and variables to store result trees
protected  boolean contextDependent()
          Returns true if this expression/instruction depends on the context.
protected  boolean dependentContents()
          Return true if any of the expressions/instructions in the contents of this node is context dependent.
 void display(int indent)
          Displays the contents of this syntax tree node (to stdout).
protected  void displayContents(int indent)
          Displays the contents of this syntax tree node (to stdout).
protected  java.lang.Object elementAt(int pos)
          Returns a child node at a given position.
protected  int elementCount()
          Returns the number of children this node has.
protected  java.util.Enumeration elements()
          Returns an Enumeration of all child nodes of this node.
protected  java.lang.String getAttribute(java.lang.String qname)
          Returns a value for an attribute from the source element.
protected  java.lang.String getAttribute(java.lang.String prefix, java.lang.String localName)
           
protected  org.xml.sax.Attributes getAttributes()
          Returns a list of all attributes declared for the element represented by this syntax tree node.
protected  java.util.Vector getContents()
          Returns a Vector containing all the child nodes of this node.
protected  int getImportPrecedence()
          Get the import precedence of this element.
 int getLineNumber()
          Get the source file line number for this element.
protected  int getNodeIDForStylesheetNSLookup()
          Retrieve an ID to identify the namespaces in scope at this point in the stylesheet
protected  SyntaxTreeNode getParent()
          Returns this syntax tree node's parent node.
 Parser getParser()
          Returns this node's XSLT parser.
protected  java.util.Hashtable getPrefixMapping()
          Returns a Hashtable containing the prefix mappings that were declared for this element.
protected  QName getQName()
          Set the QName for the SyntaxTreeNode
 Stylesheet getStylesheet()
          Get the Stylesheet node that represents the element that this node occured under.
protected  SymbolTable getSymbolTable()
          Returns the XSLT parser's symbol table.
protected  Template getTemplate()
          Get the Template node that represents the element that this node occured under.
protected  XSLTC getXSLTC()
          Returns a reference to the XSLTC (XSLT compiler) in use.
protected  boolean hasAttribute(java.lang.String qname)
           
protected  boolean hasContents()
          Tells you if this node has any child nodes.
protected  void indent(int indent)
          Set the indentation level for debug output.
private  boolean isAdaptiveRTF(SyntaxTreeNode node)
          Return true if the node represents an adaptive RTF.
protected  boolean isDummy()
          Returns 'true' if this syntax tree node is the Sentinal node.
private  boolean isSimpleRTF(SyntaxTreeNode node)
          Return true if the node represents a simple RTF.
private  boolean isTextElement(SyntaxTreeNode node, boolean doExtendedCheck)
          Return true if the node only produces Text content.
protected  SyntaxTreeNode lastChild()
          Returns this element's last child
protected  java.lang.String lookupNamespace(java.lang.String prefix)
          Returns any namespace URI that is in scope for a given prefix.
protected  java.lang.String lookupPrefix(java.lang.String uri)
          Returns any namespace prefix that is mapped to a prefix in the current scope.
protected  void parseChildren(Parser parser)
          Parse all children of this syntax tree node.
 void parseContents(Parser parser)
          Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions).
protected  void removeElement(SyntaxTreeNode element)
          Removed a child node of this syntax tree node.
protected  void reportError(SyntaxTreeNode element, Parser parser, java.lang.String errorCode, java.lang.String message)
          Report an error to the parser.
protected  void reportWarning(SyntaxTreeNode element, Parser parser, java.lang.String errorCode, java.lang.String message)
          Report a recoverable error to the parser.
protected  void setAttributes(AttributeList attributes)
          Set the attributes for this SyntaxTreeNode.
protected  void setFirstElement(SyntaxTreeNode element)
          Inserts the first child node of this syntax tree node.
protected  void setLineNumber(int line)
          Set the source file line number for this element
protected  void setParent(SyntaxTreeNode parent)
          Set this syntax tree node's parent node
protected  void setParser(Parser parser)
          Set this node's parser.
protected  void setPrefixMapping(java.util.Hashtable mapping)
          Sets the prefix mapping for the namespaces that were declared in this element.
protected  void setQName(QName qname)
          Set the QName for the syntax tree node.
protected  void setQName(java.lang.String uri, java.lang.String prefix, java.lang.String localname)
          Set the QName for the SyntaxTreeNode
abstract  void translate(ClassGenerator classGen, MethodGenerator methodGen)
          Translate this abstract syntax tree node into JVM bytecodes.
protected  void translateContents(ClassGenerator classGen, MethodGenerator methodGen)
          Call translate() on all child syntax tree nodes.
abstract  Type typeCheck(SymbolTable stable)
          Type check the children of this node.
protected  Type typeCheckContents(SymbolTable stable)
          Call typeCheck() on all child syntax tree nodes.
protected  QName updateScope(Parser parser, SyntaxTreeNode node)
          Add a node to the current scope and return name of a variable or parameter if the node represents a variable or a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parser

private Parser _parser

_parent

protected SyntaxTreeNode _parent

_stylesheet

private Stylesheet _stylesheet

_template

private Template _template

_contents

private final java.util.Vector _contents

_qname

protected QName _qname

_line

private int _line

_attributes

protected AttributeList _attributes

_prefixMapping

private java.util.Hashtable _prefixMapping

UNKNOWN_STYLESHEET_NODE_ID

public static final int UNKNOWN_STYLESHEET_NODE_ID
See Also:
Constant Field Values

_nodeIDForStylesheetNSLookup

private int _nodeIDForStylesheetNSLookup

Dummy

static final SyntaxTreeNode Dummy

IndentIncrement

protected static final int IndentIncrement
See Also:
Constant Field Values

_spaces

private static final char[] _spaces
Constructor Detail

SyntaxTreeNode

public SyntaxTreeNode()
Creates a new SyntaxTreeNode with a 'null' QName and no source file line number reference.


SyntaxTreeNode

public SyntaxTreeNode(int line)
Creates a new SyntaxTreeNode with a 'null' QName.

Parameters:
line - Source file line number reference

SyntaxTreeNode

public SyntaxTreeNode(java.lang.String uri,
                      java.lang.String prefix,
                      java.lang.String local)
Creates a new SyntaxTreeNode with no source file line number reference.

Parameters:
uri - The element's namespace URI
prefix - The element's namespace prefix
local - The element's local name
Method Detail

setLineNumber

protected final void setLineNumber(int line)
Set the source file line number for this element

Parameters:
line - The source file line number.

getLineNumber

public final int getLineNumber()
Get the source file line number for this element. If unavailable, lookup in ancestors.

Returns:
The source file line number.

setQName

protected void setQName(QName qname)
Set the QName for the syntax tree node.

Parameters:
qname - The QName for the syntax tree node

setQName

protected void setQName(java.lang.String uri,
                        java.lang.String prefix,
                        java.lang.String localname)
Set the QName for the SyntaxTreeNode

Parameters:
uri - The element's namespace URI
prefix - The element's namespace prefix
local - The element's local name

getQName

protected QName getQName()
Set the QName for the SyntaxTreeNode

Parameters:
qname - The QName for the syntax tree node

setAttributes

protected void setAttributes(AttributeList attributes)
Set the attributes for this SyntaxTreeNode.

Parameters:
attributes - Attributes for the element. Must be passed in as an implementation of org.xml.sax.Attributes.

getAttribute

protected java.lang.String getAttribute(java.lang.String qname)
Returns a value for an attribute from the source element.

Parameters:
qname - The QName of the attribute to return.
Returns:
The value of the attribute of name 'qname'.

getAttribute

protected java.lang.String getAttribute(java.lang.String prefix,
                                        java.lang.String localName)

hasAttribute

protected boolean hasAttribute(java.lang.String qname)

addAttribute

protected void addAttribute(java.lang.String qname,
                            java.lang.String value)

getAttributes

protected org.xml.sax.Attributes getAttributes()
Returns a list of all attributes declared for the element represented by this syntax tree node.

Returns:
Attributes for this syntax tree node

setPrefixMapping

protected void setPrefixMapping(java.util.Hashtable mapping)
Sets the prefix mapping for the namespaces that were declared in this element. This does not include all prefix mappings in scope, so one may have to check ancestor elements to get all mappings that are in in scope. The prefixes must be passed in as a Hashtable that maps namespace prefixes (String objects) to namespace URIs (also String).

Parameters:
mapping - The Hashtable containing the mappings.

getPrefixMapping

protected java.util.Hashtable getPrefixMapping()
Returns a Hashtable containing the prefix mappings that were declared for this element. This does not include all prefix mappings in scope, so one may have to check ancestor elements to get all mappings that are in in scope.

Returns:
Prefix mappings (for this element only).

addPrefixMapping

protected void addPrefixMapping(java.lang.String prefix,
                                java.lang.String uri)
Adds a single prefix mapping to this syntax tree node.

Parameters:
prefix - Namespace prefix.
uri - Namespace URI.

lookupNamespace

protected java.lang.String lookupNamespace(java.lang.String prefix)
Returns any namespace URI that is in scope for a given prefix. This method checks namespace mappings for this element, and if necessary for ancestor elements as well (ie. if the prefix maps to an URI in this scope then you'll definately get the URI from this method).

Parameters:
prefix - Namespace prefix.
Returns:
Namespace URI.

lookupPrefix

protected java.lang.String lookupPrefix(java.lang.String uri)
Returns any namespace prefix that is mapped to a prefix in the current scope. This method checks namespace mappings for this element, and if necessary for ancestor elements as well (ie. if the URI is declared within the current scope then you'll definately get the prefix from this method). Note that this is a very slow method and consequentially it should only be used strictly when needed.

Parameters:
uri - Namespace URI.
Returns:
Namespace prefix.

setParser

protected void setParser(Parser parser)
Set this node's parser. The parser (the XSLT parser) gives this syntax tree node access to the symbol table and XPath parser.

Parameters:
parser - The XSLT parser.

getParser

public final Parser getParser()
Returns this node's XSLT parser.

Returns:
The XSLT parser.

setParent

protected void setParent(SyntaxTreeNode parent)
Set this syntax tree node's parent node

Parameters:
parent - The parent node.

getParent

protected final SyntaxTreeNode getParent()
Returns this syntax tree node's parent node.

Returns:
The parent syntax tree node.

isDummy

protected final boolean isDummy()
Returns 'true' if this syntax tree node is the Sentinal node.

Returns:
'true' if this syntax tree node is the Sentinal node.

getImportPrecedence

protected int getImportPrecedence()
Get the import precedence of this element. The import precedence equals the import precedence of the stylesheet in which this element occured.

Returns:
The import precedence of this syntax tree node.

getStylesheet

public Stylesheet getStylesheet()
Get the Stylesheet node that represents the element that this node occured under.

Returns:
The Stylesheet ancestor node of this node.

getTemplate

protected Template getTemplate()
Get the Template node that represents the element that this node occured under. Note that this method will return 'null' for nodes that represent top-level elements.

Returns:
The Template ancestor node of this node or 'null'.

getXSLTC

protected final XSLTC getXSLTC()
Returns a reference to the XSLTC (XSLT compiler) in use.

Returns:
XSLTC - XSLT compiler.

getSymbolTable

protected final SymbolTable getSymbolTable()
Returns the XSLT parser's symbol table.

Returns:
Symbol table.

parseContents

public void parseContents(Parser parser)
Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions). The default behaviour is to parser the syntax tree node's children (since there are no common expressions, patterns, etc. that can be handled in this base class.

Parameters:
parser - reference to the XSLT parser

parseChildren

protected final void parseChildren(Parser parser)
Parse all children of this syntax tree node. This method is normally called by the parseContents() method.

Parameters:
parser - reference to the XSLT parser

updateScope

protected QName updateScope(Parser parser,
                            SyntaxTreeNode node)
Add a node to the current scope and return name of a variable or parameter if the node represents a variable or a parameter.


typeCheck

public abstract Type typeCheck(SymbolTable stable)
                        throws TypeCheckError
Type check the children of this node. The type check phase may add coercions (CastExpr) to the AST.

Parameters:
stable - The compiler/parser's symbol table
Throws:
TypeCheckError

typeCheckContents

protected Type typeCheckContents(SymbolTable stable)
                          throws TypeCheckError
Call typeCheck() on all child syntax tree nodes.

Parameters:
stable - The compiler/parser's symbol table
Throws:
TypeCheckError

translate

public abstract void translate(ClassGenerator classGen,
                               MethodGenerator methodGen)
Translate this abstract syntax tree node into JVM bytecodes.

Parameters:
classGen - BCEL Java class generator
methodGen - BCEL Java method generator

translateContents

protected void translateContents(ClassGenerator classGen,
                                 MethodGenerator methodGen)
Call translate() on all child syntax tree nodes.

Parameters:
classGen - BCEL Java class generator
methodGen - BCEL Java method generator

isSimpleRTF

private boolean isSimpleRTF(SyntaxTreeNode node)
Return true if the node represents a simple RTF. A node is a simple RTF if all children only produce Text value.

Parameters:
node - A node
Returns:
true if the node content can be considered as a simple RTF.

isAdaptiveRTF

private boolean isAdaptiveRTF(SyntaxTreeNode node)
Return true if the node represents an adaptive RTF. A node is an adaptive RTF if each children is a Text element or it is or .

Parameters:
node - A node
Returns:
true if the node content can be considered as an adaptive RTF.

isTextElement

private boolean isTextElement(SyntaxTreeNode node,
                              boolean doExtendedCheck)
Return true if the node only produces Text content. A node is a Text element if it is Text, xsl:value-of, xsl:number, or a combination of these nested in a control instruction (xsl:if or xsl:choose). If the doExtendedCheck flag is true, xsl:call-template and xsl:apply-templates are also considered as Text elements.

Parameters:
node - A node
doExtendedCheck - If this flag is true, and are also considered as Text elements.
Returns:
true if the node of Text type

compileResultTree

protected void compileResultTree(ClassGenerator classGen,
                                 MethodGenerator methodGen)
Utility method used by parameters and variables to store result trees

Parameters:
classGen - BCEL Java class generator
methodGen - BCEL Java method generator

getNodeIDForStylesheetNSLookup

protected final int getNodeIDForStylesheetNSLookup()
Retrieve an ID to identify the namespaces in scope at this point in the stylesheet

Returns:
An int representing the node ID or -1 if no namespace declarations are in scope

contextDependent

protected boolean contextDependent()
Returns true if this expression/instruction depends on the context. By default, every expression/instruction depends on the context unless it overrides this method. Currently used to determine if result trees are compiled using procedures or little DOMs (result tree fragments).

Returns:
'true' if this node depends on the context.

dependentContents

protected boolean dependentContents()
Return true if any of the expressions/instructions in the contents of this node is context dependent.

Returns:
'true' if the contents of this node is context dependent.

addElement

protected final void addElement(SyntaxTreeNode element)
Adds a child node to this syntax tree node.

Parameters:
element - is the new child node.

setFirstElement

protected final void setFirstElement(SyntaxTreeNode element)
Inserts the first child node of this syntax tree node. The existing children are shifted back one position.

Parameters:
element - is the new child node.

removeElement

protected final void removeElement(SyntaxTreeNode element)
Removed a child node of this syntax tree node.

Parameters:
element - is the child node to remove.

getContents

protected final java.util.Vector getContents()
Returns a Vector containing all the child nodes of this node.

Returns:
A Vector containing all the child nodes of this node.

hasContents

protected final boolean hasContents()
Tells you if this node has any child nodes.

Returns:
'true' if this node has any children.

elementCount

protected final int elementCount()
Returns the number of children this node has.

Returns:
Number of child nodes.

elements

protected final java.util.Enumeration elements()
Returns an Enumeration of all child nodes of this node.

Returns:
An Enumeration of all child nodes of this node.

elementAt

protected final java.lang.Object elementAt(int pos)
Returns a child node at a given position.

Parameters:
pos - The child node's position.
Returns:
The child node.

lastChild

protected final SyntaxTreeNode lastChild()
Returns this element's last child

Returns:
The child node.

display

public void display(int indent)
Displays the contents of this syntax tree node (to stdout). This method is intended for debugging _only_, and should be overridden by all syntax tree node implementations.

Parameters:
indent - Indentation level for syntax tree levels.

displayContents

protected void displayContents(int indent)
Displays the contents of this syntax tree node (to stdout). This method is intended for debugging _only_ !!!

Parameters:
indent - Indentation level for syntax tree levels.

indent

protected final void indent(int indent)
Set the indentation level for debug output.

Parameters:
indent - Indentation level for syntax tree levels.

reportError

protected void reportError(SyntaxTreeNode element,
                           Parser parser,
                           java.lang.String errorCode,
                           java.lang.String message)
Report an error to the parser.

Parameters:
element - The element in which the error occured (normally 'this' but it could also be an expression/pattern/etc.)
parser - The XSLT parser to report the error to.
error - The error code (from util/ErrorMsg).
message - Any additional error message.

reportWarning

protected void reportWarning(SyntaxTreeNode element,
                             Parser parser,
                             java.lang.String errorCode,
                             java.lang.String message)
Report a recoverable error to the parser.

Parameters:
element - The element in which the error occured (normally 'this' but it could also be an expression/pattern/etc.)
parser - The XSLT parser to report the error to.
error - The error code (from util/ErrorMsg).
message - Any additional error message.