org.apache.xalan.templates
Class Stylesheet

java.lang.Object
  extended byorg.apache.xml.utils.UnImplNode
      extended byorg.apache.xalan.templates.ElemTemplateElement
          extended byorg.apache.xalan.templates.Stylesheet
All Implemented Interfaces:
org.w3c.dom.Document, org.w3c.dom.Element, ExpressionNode, org.w3c.dom.Node, org.w3c.dom.NodeList, PrefixResolver, Serializable, javax.xml.transform.SourceLocator, WhitespaceStrippingElementMatcher, XSLTVisitable
Direct Known Subclasses:
StylesheetComposed

public class Stylesheet
extends ElemTemplateElement
implements Serializable

Represents a stylesheet element.

All properties in this class have a fixed form of bean-style property accessors for all properties that represent XSL attributes or elements. These properties have setter method names accessed generically by the processor, and so these names must be fixed according to the system defined in the getSetterMethodName function.

 

 

 
 

 
 

 

See Also:
section-Stylesheet-Structure in XSLT Specification, Serialized Form

Field Summary
private  Vector m_attributeSets
          The "xsl:attribute-set" property.
(package private)  Stack m_DecimalFormatDeclarations
          Table of tables of element decimal-format.
private  StringVector m_ExcludeResultPrefixs
          The "exclude-result-prefixes" property.
private  StringVector m_ExtensionElementURIs
          The "extension-element-prefixes" property, actually contains URIs.
private  String m_href
          The base URL of the XSL document.
private  String m_Id
          The "id" property.
private  Vector m_imports
          The "xsl:import" list.
private  Vector m_includes
          The "xsl:include" properties.
private  Vector m_keyDeclarations
          The "xsl:key" property.
private  Hashtable m_NonXslTopLevel
          The "non-xsl-top-level" properties.
private  Vector m_output
          The "xsl:output" properties.
private  Vector m_prefix_aliases
          The "xsl:namespace-alias" properties.
private  String m_publicId
          The doctype-public element.
private  Stylesheet m_stylesheetParent
          The parent of the stylesheet.
private  StylesheetRoot m_stylesheetRoot
          The root of the stylesheet, where all the tables common to all stylesheets are kept.
private  String m_systemId
          The doctype-system element.
private  Vector m_templates
          The "xsl:template" properties.
private  Vector m_topLevelVariables
          The "xsl:variable" and "xsl:param" properties.
private  String m_Version
          The "version" property.
private  Vector m_whitespacePreservingElements
          The "xsl:preserve-space" property, A lookup table of all space preserving elements.
private  Vector m_whitespaceStrippingElements
          The "xsl:strip-space" properties, A lookup table of all space stripping elements.
private  String m_XmlnsXsl
          The "xmlns:xsl" property.
static String STYLESHEET_EXT
          Extension to be used when serializing to disk.
 
Fields inherited from class org.apache.xalan.templates.ElemTemplateElement
m_docOrderNumber, m_firstChild, m_hasVariableDecl, m_nextSibling, m_parentNode, m_prefixTable
 
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
 
Constructor Summary
Stylesheet(Stylesheet parent)
          Constructor for a Stylesheet.
 
Method Summary
protected  boolean accept(XSLTVisitor visitor)
          Accept a visitor and call the appropriate method for this class.
protected  void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
          Call the children visitors.
 boolean containsExcludeResultPrefix(String prefix, String uri)
          Get whether or not the passed prefix is contained flagged by the "exclude-result-prefixes" property.
 boolean containsExtensionElementURI(String uri)
          Find out if this contains a given "extension-element-prefix" property.
 ElemAttributeSet getAttributeSet(int i)
          Get an "xsl:attribute-set" property.
 int getAttributeSetCount()
          Get the number of "xsl:attribute-set" properties.
 DecimalFormatProperties getDecimalFormat(int i)
          Get an "xsl:decimal-format" property.
 DecimalFormatProperties getDecimalFormat(QName name)
          Get an "xsl:decimal-format" property.
 int getDecimalFormatCount()
          Get the number of xsl:decimal-format declarations.
 String getExcludeResultPrefix(int i)
          Get an "exclude-result-prefix" property.
 int getExcludeResultPrefixCount()
          Get the number of "exclude-result-prefixes" Strings.
 String getExtensionElementPrefix(int i)
          Get and "extension-element-prefix" property.
 int getExtensionElementPrefixCount()
          Get the number of "extension-element-prefixes" Strings.
 String getHref()
          Get the base identifier with which this stylesheet is associated.
 String getId()
          Get the "id" property.
 StylesheetComposed getImport(int i)
          Get a stylesheet from the "import" list.
 int getImportCount()
          Get the number of imported stylesheets.
 Stylesheet getInclude(int i)
          Get the stylesheet at the given in index in "include" list
 int getIncludeCount()
          Get the number of included stylesheets.
 KeyDeclaration getKey(int i)
          Get an "xsl:key" property.
 int getKeyCount()
          Get the number of "xsl:key" properties.
 NamespaceAlias getNamespaceAlias(int i)
          Get an "xsl:namespace-alias" property.
 int getNamespaceAliasCount()
          Get the number of "xsl:namespace-alias" properties.
 String getNodeName()
          Return the node name.
 short getNodeType()
          Get the type of the node.
 Object getNonXslTopLevel(QName name)
          Get a non-xslt element.
 OutputProperties getOutput(int i)
          Get an "xsl:output" property.
 int getOutputCount()
          Get the number of "xsl:output" properties.
 ElemParam getParam(QName qname)
          Get an "xsl:param" property.
 WhiteSpaceInfo getPreserveSpace(int i)
          Get a "xsl:preserve-space" property.
 int getPreserveSpaceCount()
          Get the number of "xsl:preserve-space" properties.
 WhiteSpaceInfo getStripSpace(int i)
          Get an "xsl:strip-space" property.
 int getStripSpaceCount()
          Get the number of "xsl:strip-space" properties.
 Stylesheet getStylesheet()
          Get the owning stylesheet.
 StylesheetComposed getStylesheetComposed()
          Get the owning aggregated stylesheet, or this stylesheet if it is aggregated.
 Stylesheet getStylesheetParent()
          Get the parent of the stylesheet.
 StylesheetRoot getStylesheetRoot()
          Get the root of the stylesheet, where all the tables common to all stylesheets are kept.
 ElemTemplate getTemplate(int i)
          Get an "xsl:template" property.
 int getTemplateCount()
          Get the number of "xsl:template" properties.
 ElemVariable getVariable(QName qname)
          Get an "xsl:variable" property.
 ElemVariable getVariableOrParam(int i)
          Get an "xsl:variable" property.
 ElemVariable getVariableOrParam(QName qname)
          Get an "xsl:variable" or "xsl:param" property.
 int getVariableOrParamCount()
          Get the number of "xsl:variable" properties.
 String getVersion()
          Get the "version" property.
 String getXmlnsXsl()
          Get the "xmlns:xsl" property.
 int getXSLToken()
          Get an integer representation of the element type.
 boolean isAggregatedType()
          Tell if this can be cast to a StylesheetComposed, meaning, you can ask questions from getXXXComposed functions.
 boolean isRoot()
          Tell if this is the root of the stylesheet tree.
private  void readObject(ObjectInputStream stream)
          Read the stylesheet from a serialization stream.
 void replaceTemplate(ElemTemplate v, int i)
          Replace an "xsl:template" property.
 void setAttributeSet(ElemAttributeSet attrSet)
          Set the "xsl:attribute-set" property.
 void setDecimalFormat(DecimalFormatProperties edf)
          Process the xsl:decimal-format element.
 void setExcludeResultPrefixes(StringVector v)
          Set the "exclude-result-prefixes" property.
 void setExtensionElementPrefixes(StringVector v)
          Set the "extension-element-prefixes" property.
 void setHref(String baseIdent)
          Set the base identifier with which this stylesheet is associated.
 void setId(String v)
          Set the "id" property.
 void setImport(StylesheetComposed v)
          Add a stylesheet to the "import" list.
 void setInclude(Stylesheet v)
          Add a stylesheet to the "include" list.
 void setKey(KeyDeclaration v)
          Set the "xsl:key" property.
 void setLocaterInfo(javax.xml.transform.SourceLocator locator)
          Set the location information for this element.
 void setNamespaceAlias(NamespaceAlias na)
          Set the "xsl:namespace-alias" property.
 void setNonXslTopLevel(QName name, Object obj)
          Set found a non-xslt element.
 void setOutput(OutputProperties v)
          Set the "xsl:output" property.
 void setParam(ElemParam v)
          Set an "xsl:param" property.
 void setPreserveSpaces(WhiteSpaceInfo wsi)
          Set the "xsl:preserve-space" property.
 void setStripSpaces(WhiteSpaceInfo wsi)
          Set the "xsl:strip-space" properties.
 void setStylesheetParent(Stylesheet v)
          Set the parent of the stylesheet.
 void setStylesheetRoot(StylesheetRoot v)
          Set the root of the stylesheet, where all the tables common to all stylesheets are kept.
 void setTemplate(ElemTemplate v)
          Set an "xsl:template" property.
 void setVariable(ElemVariable v)
          Set the "xsl:variable" property.
 void setVersion(String v)
          Set the "version" property.
 void setXmlnsXsl(String v)
          Set the "xmlns:xsl" property.
private  void writeObject(ObjectOutputStream stream)
          Write out the given output stream
 
Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
addOrReplaceDecls, appendChild, appendChild, callChildVisitors, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, compose, endCompose, error, error, execute, executeNSDecls, executeNSDecls, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getLocalName, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getOwnerDocument, getOwnerXSLTemplate, getParentElem, getParentNode, getParentNodeElem, getPrefixes, getPreviousSibling, getPreviousSiblingElem, getPublicId, getSystemId, getTagName, getUid, getXmlSpace, handlesNullPrefixes, hasChildNodes, hasTextLitOnly, hasVariableDecl, insertBefore, isCompiledTemplate, isValidNCName, item, needToCheckExclude, recompose, removeChild, replaceChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setParentElem, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpace, unexecuteNSDecls, unexecuteNSDecls
 
Methods inherited from class org.apache.xml.utils.UnImplNode
adoptNode, appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getImplementation, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSpecified, getStandalone, getStrictErrorChecking, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertData, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceData, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setEncoding, setNodeValue, setPrefix, setStandalone, setStrictErrorChecking, setValue, splitText, substringData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLESHEET_EXT

public static final String STYLESHEET_EXT
Extension to be used when serializing to disk.

See Also:
Constant Field Values

m_XmlnsXsl

private String m_XmlnsXsl
The "xmlns:xsl" property.


m_ExtensionElementURIs

private StringVector m_ExtensionElementURIs
The "extension-element-prefixes" property, actually contains URIs.


m_ExcludeResultPrefixs

private StringVector m_ExcludeResultPrefixs
The "exclude-result-prefixes" property.


m_Id

private String m_Id
The "id" property.


m_Version

private String m_Version
The "version" property.


m_imports

private Vector m_imports
The "xsl:import" list.


m_includes

private Vector m_includes
The "xsl:include" properties.


m_DecimalFormatDeclarations

Stack m_DecimalFormatDeclarations
Table of tables of element decimal-format.

See Also:
DecimalFormatProperties

m_whitespaceStrippingElements

private Vector m_whitespaceStrippingElements
The "xsl:strip-space" properties, A lookup table of all space stripping elements.


m_whitespacePreservingElements

private Vector m_whitespacePreservingElements
The "xsl:preserve-space" property, A lookup table of all space preserving elements.


m_output

private Vector m_output
The "xsl:output" properties. This is a vector of OutputProperties objects.


m_keyDeclarations

private Vector m_keyDeclarations
The "xsl:key" property.


m_attributeSets

private Vector m_attributeSets
The "xsl:attribute-set" property.


m_topLevelVariables

private Vector m_topLevelVariables
The "xsl:variable" and "xsl:param" properties.


m_templates

private Vector m_templates
The "xsl:template" properties.


m_prefix_aliases

private Vector m_prefix_aliases
The "xsl:namespace-alias" properties.


m_NonXslTopLevel

private Hashtable m_NonXslTopLevel
The "non-xsl-top-level" properties.


m_href

private String m_href
The base URL of the XSL document.


m_publicId

private String m_publicId
The doctype-public element.


m_systemId

private String m_systemId
The doctype-system element.


m_stylesheetRoot

private StylesheetRoot m_stylesheetRoot
The root of the stylesheet, where all the tables common to all stylesheets are kept.


m_stylesheetParent

private Stylesheet m_stylesheetParent
The parent of the stylesheet. This will be null if this is the root stylesheet.

Constructor Detail

Stylesheet

public Stylesheet(Stylesheet parent)
Constructor for a Stylesheet.

Parameters:
parent - The including or importing stylesheet.
Method Detail

getStylesheet

public Stylesheet getStylesheet()
Get the owning stylesheet. This looks up the inheritance chain until it calls getStylesheet on a Stylesheet object, which will return itself.

Overrides:
getStylesheet in class ElemTemplateElement
Returns:
The owning stylesheet, itself.

isAggregatedType

public boolean isAggregatedType()
Tell if this can be cast to a StylesheetComposed, meaning, you can ask questions from getXXXComposed functions.

Returns:
False if this is not a StylesheetComposed

isRoot

public boolean isRoot()
Tell if this is the root of the stylesheet tree.

Returns:
False is this is not the root of the stylesheet tree.

readObject

private void readObject(ObjectInputStream stream)
                 throws IOException,
                        javax.xml.transform.TransformerException
Read the stylesheet from a serialization stream.

Parameters:
stream - Input stream to read from
Throws:
IOException
javax.xml.transform.TransformerException

writeObject

private void writeObject(ObjectOutputStream stream)
                  throws IOException
Write out the given output stream

Parameters:
stream - The output stream to write out
Throws:
IOException

setXmlnsXsl

public void setXmlnsXsl(String v)
Set the "xmlns:xsl" property.

Parameters:
v - The value to be set for the "xmlns:xsl" property.
See Also:
xslt-namespace in XSLT Specification

getXmlnsXsl

public String getXmlnsXsl()
Get the "xmlns:xsl" property.

Returns:
The value of the "xmlns:xsl" property.
See Also:
xslt-namespace in XSLT Specification

setExtensionElementPrefixes

public void setExtensionElementPrefixes(StringVector v)
Set the "extension-element-prefixes" property.

Parameters:
v - The value to be set for the "extension-element-prefixes" property: a vector of extension element URIs.
See Also:
extension-element in XSLT Specification

getExtensionElementPrefix

public String getExtensionElementPrefix(int i)
                                 throws ArrayIndexOutOfBoundsException
Get and "extension-element-prefix" property.

Parameters:
i - Index of extension element URI in list
Returns:
The extension element URI at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
extension-element in XSLT Specification

getExtensionElementPrefixCount

public int getExtensionElementPrefixCount()
Get the number of "extension-element-prefixes" Strings.

Returns:
Number of URIs in the list
See Also:
extension-element in XSLT Specification

containsExtensionElementURI

public boolean containsExtensionElementURI(String uri)
Find out if this contains a given "extension-element-prefix" property.

Parameters:
uri - URI of extension element to look for
Returns:
True if the given URI was found in the list
See Also:
extension-element in XSLT Specification

setExcludeResultPrefixes

public void setExcludeResultPrefixes(StringVector v)
Set the "exclude-result-prefixes" property. The designation of a namespace as an excluded namespace is effective within the subtree of the stylesheet rooted at the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute; a subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element.

Parameters:
v - A StringVector of prefixes to exclude
See Also:
literal-result-element in XSLT Specification

getExcludeResultPrefix

public String getExcludeResultPrefix(int i)
                              throws ArrayIndexOutOfBoundsException
Get an "exclude-result-prefix" property. The designation of a namespace as an excluded namespace is effective within the subtree of the stylesheet rooted at the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute; a subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element.

Parameters:
i - Index of prefix to get in list
Returns:
Prefix to be excluded at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
literal-result-element in XSLT Specification

getExcludeResultPrefixCount

public int getExcludeResultPrefixCount()
Get the number of "exclude-result-prefixes" Strings.

Returns:
The number of prefix strings to be excluded.
See Also:
literal-result-element in XSLT Specification

containsExcludeResultPrefix

public boolean containsExcludeResultPrefix(String prefix,
                                           String uri)
Get whether or not the passed prefix is contained flagged by the "exclude-result-prefixes" property.

Overrides:
containsExcludeResultPrefix in class ElemTemplateElement
Parameters:
prefix - non-null reference to prefix that might be excluded.
uri - reference to namespace that prefix maps to
Returns:
true if the prefix should normally be excluded.>
See Also:
literal-result-element in XSLT Specification

setId

public void setId(String v)
Set the "id" property.

Parameters:
v - Value for the "id" property.
See Also:
section-Embedding-Stylesheets in XSLT Specification

getId

public String getId()
Get the "id" property.

Returns:
The value of the "id" property.
See Also:
section-Embedding-Stylesheets in XSLT Specification

setVersion

public void setVersion(String v)
Set the "version" property.

Overrides:
setVersion in class UnImplNode
Parameters:
v - Value for the "version" property.
See Also:
forwards in XSLT Specification

getVersion

public String getVersion()
Get the "version" property.

Overrides:
getVersion in class UnImplNode
Returns:
The value of the "version" property.
See Also:
forwards in XSLT Specification

setImport

public void setImport(StylesheetComposed v)
Add a stylesheet to the "import" list.

Parameters:
v - Stylesheet to add to the import list
See Also:
import in XSLT Specification

getImport

public StylesheetComposed getImport(int i)
                             throws ArrayIndexOutOfBoundsException
Get a stylesheet from the "import" list.

Parameters:
i - Index of the stylesheet to get
Returns:
The stylesheet at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
import in XSLT Specification

getImportCount

public int getImportCount()
Get the number of imported stylesheets.

Returns:
the number of imported stylesheets.
See Also:
import in XSLT Specification

setInclude

public void setInclude(Stylesheet v)
Add a stylesheet to the "include" list.

Parameters:
v - Stylesheet to add to the "include" list
See Also:
include in XSLT Specification

getInclude

public Stylesheet getInclude(int i)
                      throws ArrayIndexOutOfBoundsException
Get the stylesheet at the given in index in "include" list

Parameters:
i - Index of stylesheet to get
Returns:
Stylesheet at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
include in XSLT Specification

getIncludeCount

public int getIncludeCount()
Get the number of included stylesheets.

Returns:
the number of included stylesheets.
See Also:
import in XSLT Specification

setDecimalFormat

public void setDecimalFormat(DecimalFormatProperties edf)
Process the xsl:decimal-format element.

Parameters:
edf - Decimal-format element to push into stack

getDecimalFormat

public DecimalFormatProperties getDecimalFormat(QName name)
Get an "xsl:decimal-format" property.

Parameters:
name - The qualified name of the decimal format property.
Returns:
null if not found, otherwise a DecimalFormatProperties object, from which you can get a DecimalFormatSymbols object.
See Also:
DecimalFormatProperties, format-number in XSLT Specification

getDecimalFormat

public DecimalFormatProperties getDecimalFormat(int i)
                                         throws ArrayIndexOutOfBoundsException
Get an "xsl:decimal-format" property.

Parameters:
i - Index of decimal-format property in stack
Returns:
The decimal-format property at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
format-number in XSLT Specification, DecimalFormatProperties

getDecimalFormatCount

public int getDecimalFormatCount()
Get the number of xsl:decimal-format declarations.

Returns:
the number of xsl:decimal-format declarations.
See Also:
DecimalFormatProperties

setStripSpaces

public void setStripSpaces(WhiteSpaceInfo wsi)
Set the "xsl:strip-space" properties.

Parameters:
wsi - WhiteSpaceInfo element to add to list
See Also:
strip in XSLT Specification

getStripSpace

public WhiteSpaceInfo getStripSpace(int i)
                             throws ArrayIndexOutOfBoundsException
Get an "xsl:strip-space" property.

Parameters:
i - Index of WhiteSpaceInfo to get
Returns:
WhiteSpaceInfo at given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
strip in XSLT Specification

getStripSpaceCount

public int getStripSpaceCount()
Get the number of "xsl:strip-space" properties.

Returns:
the number of "xsl:strip-space" properties.
See Also:
strip in XSLT Specification

setPreserveSpaces

public void setPreserveSpaces(WhiteSpaceInfo wsi)
Set the "xsl:preserve-space" property.

Parameters:
wsi - WhiteSpaceInfo element to add to list
See Also:
strip in XSLT Specification

getPreserveSpace

public WhiteSpaceInfo getPreserveSpace(int i)
                                throws ArrayIndexOutOfBoundsException
Get a "xsl:preserve-space" property.

Parameters:
i - Index of WhiteSpaceInfo to get
Returns:
WhiteSpaceInfo at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
strip in XSLT Specification

getPreserveSpaceCount

public int getPreserveSpaceCount()
Get the number of "xsl:preserve-space" properties.

Returns:
the number of "xsl:preserve-space" properties.
See Also:
strip in XSLT Specification

setOutput

public void setOutput(OutputProperties v)
Set the "xsl:output" property.

Parameters:
v - non-null reference to the OutputProperties object to be added to the collection.
See Also:
output in XSLT Specification

getOutput

public OutputProperties getOutput(int i)
                           throws ArrayIndexOutOfBoundsException
Get an "xsl:output" property.

Parameters:
i - Index of OutputFormatExtended to get
Returns:
non-null reference to an OutputProperties object.
Throws:
ArrayIndexOutOfBoundsException
See Also:
output in XSLT Specification

getOutputCount

public int getOutputCount()
Get the number of "xsl:output" properties.

Returns:
The number of OutputProperties objects contained in this stylesheet.
See Also:
output in XSLT Specification

setKey

public void setKey(KeyDeclaration v)
Set the "xsl:key" property.

Parameters:
v - KeyDeclaration element to add to the list of key declarations
See Also:
key in XSLT Specification

getKey

public KeyDeclaration getKey(int i)
                      throws ArrayIndexOutOfBoundsException
Get an "xsl:key" property.

Parameters:
i - Index of KeyDeclaration element to get
Returns:
KeyDeclaration element at given index in list
Throws:
ArrayIndexOutOfBoundsException
See Also:
key in XSLT Specification

getKeyCount

public int getKeyCount()
Get the number of "xsl:key" properties.

Returns:
the number of "xsl:key" properties.
See Also:
key in XSLT Specification

setAttributeSet

public void setAttributeSet(ElemAttributeSet attrSet)
Set the "xsl:attribute-set" property.

Parameters:
attrSet - ElemAttributeSet to add to the list of attribute sets
See Also:
attribute-sets in XSLT Specification

getAttributeSet

public ElemAttributeSet getAttributeSet(int i)
                                 throws ArrayIndexOutOfBoundsException
Get an "xsl:attribute-set" property.

Parameters:
i - Index of ElemAttributeSet to get in list
Returns:
ElemAttributeSet at the given index
Throws:
ArrayIndexOutOfBoundsException
See Also:
attribute-sets in XSLT Specification

getAttributeSetCount

public int getAttributeSetCount()
Get the number of "xsl:attribute-set" properties.

Returns:
the number of "xsl:attribute-set" properties.
See Also:
attribute-sets in XSLT Specification

setVariable

public void setVariable(ElemVariable v)
Set the "xsl:variable" property.

Parameters:
v - ElemVariable object to add to list of top level variables
See Also:
top-level-variables in XSLT Specification

getVariableOrParam

public ElemVariable getVariableOrParam(QName qname)
Get an "xsl:variable" or "xsl:param" property.

Parameters:
qname - non-null reference to the qualified name of the variable.
Returns:
The ElemVariable with the given name in the list or null
See Also:
top-level-variables in XSLT Specification

getVariable

public ElemVariable getVariable(QName qname)
Get an "xsl:variable" property.

Parameters:
qname - Qualified name of the xsl:variable to get
Returns:
reference to the variable named by qname, or null if not found.
See Also:
top-level-variables in XSLT Specification

getVariableOrParam

public ElemVariable getVariableOrParam(int i)
                                throws ArrayIndexOutOfBoundsException
Get an "xsl:variable" property.

Parameters:
i - Index of variable to get in the list
Returns:
ElemVariable at the given index in the list
Throws:
ArrayIndexOutOfBoundsException
See Also:
top-level-variables in XSLT Specification

getVariableOrParamCount

public int getVariableOrParamCount()
Get the number of "xsl:variable" properties.

Returns:
the number of "xsl:variable" properties.
See Also:
top-level-variables in XSLT Specification

setParam

public void setParam(ElemParam v)
Set an "xsl:param" property.

Parameters:
v - A non-null ElemParam reference.
See Also:
top-level-variables in XSLT Specification

getParam

public ElemParam getParam(QName qname)
Get an "xsl:param" property.

Parameters:
qname - non-null reference to qualified name of the parameter.
Returns:
ElemParam with the given name in the list or null
See Also:
top-level-variables in XSLT Specification

setTemplate

public void setTemplate(ElemTemplate v)
Set an "xsl:template" property.

Parameters:
v - ElemTemplate to add to list of templates
See Also:
section-Defining-Template-Rules in XSLT Specification

getTemplate

public ElemTemplate getTemplate(int i)
                         throws javax.xml.transform.TransformerException
Get an "xsl:template" property.

Parameters:
i - Index of ElemTemplate in the list to get
Returns:
ElemTemplate at the given index in the list
Throws:
javax.xml.transform.TransformerException
See Also:
section-Defining-Template-Rules in XSLT Specification

getTemplateCount

public int getTemplateCount()
Get the number of "xsl:template" properties.

Returns:
the number of "xsl:template" properties.
See Also:
section-Defining-Template-Rules in XSLT Specification

setNamespaceAlias

public void setNamespaceAlias(NamespaceAlias na)
Set the "xsl:namespace-alias" property.

Parameters:
na - NamespaceAlias elemeent to add to the list
See Also:
literal-result-element in XSLT Specification

getNamespaceAlias

public NamespaceAlias getNamespaceAlias(int i)
                                 throws ArrayIndexOutOfBoundsException
Get an "xsl:namespace-alias" property.

Parameters:
i - Index of NamespaceAlias element to get from the list
Returns:
NamespaceAlias element at the given index in the list
Throws:
ArrayIndexOutOfBoundsException
See Also:
literal-result-element in XSLT Specification

getNamespaceAliasCount

public int getNamespaceAliasCount()
Get the number of "xsl:namespace-alias" properties.

Returns:
the number of "xsl:namespace-alias" properties.
See Also:
top-level-variables in XSLT Specification

setNonXslTopLevel

public void setNonXslTopLevel(QName name,
                              Object obj)
Set found a non-xslt element.

Parameters:
name - Qualified name of the element
obj - The element object
See Also:
stylesheet-element in XSLT Specification

getNonXslTopLevel

public Object getNonXslTopLevel(QName name)
Get a non-xslt element.

Parameters:
name - Qualified name of the element to get
Returns:
The object associate with the given name
See Also:
stylesheet-element in XSLT Specification

getHref

public String getHref()
Get the base identifier with which this stylesheet is associated.

Returns:
the base identifier with which this stylesheet is associated.

setHref

public void setHref(String baseIdent)
Set the base identifier with which this stylesheet is associated.

Parameters:
baseIdent - the base identifier with which this stylesheet is associated.

setLocaterInfo

public void setLocaterInfo(javax.xml.transform.SourceLocator locator)
Set the location information for this element.

Overrides:
setLocaterInfo in class ElemTemplateElement
Parameters:
locator - SourceLocator object with location information

getStylesheetRoot

public StylesheetRoot getStylesheetRoot()
Get the root of the stylesheet, where all the tables common to all stylesheets are kept.

Overrides:
getStylesheetRoot in class ElemTemplateElement
Returns:
the root of the stylesheet

setStylesheetRoot

public void setStylesheetRoot(StylesheetRoot v)
Set the root of the stylesheet, where all the tables common to all stylesheets are kept.

Parameters:
v - the root of the stylesheet

getStylesheetParent

public Stylesheet getStylesheetParent()
Get the parent of the stylesheet. This will be null if this is the root stylesheet.

Returns:
the parent of the stylesheet.

setStylesheetParent

public void setStylesheetParent(Stylesheet v)
Set the parent of the stylesheet. This should be null if this is the root stylesheet.

Parameters:
v - the parent of the stylesheet.

getStylesheetComposed

public StylesheetComposed getStylesheetComposed()
Get the owning aggregated stylesheet, or this stylesheet if it is aggregated.

Overrides:
getStylesheetComposed in class ElemTemplateElement
Returns:
the owning aggregated stylesheet or itself

getNodeType

public short getNodeType()
Get the type of the node. We'll pretend we're a Document.

Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class ElemTemplateElement
Returns:
the type of the node: document node.

getXSLToken

public int getXSLToken()
Get an integer representation of the element type.

Overrides:
getXSLToken in class ElemTemplateElement
Returns:
An integer representation of the element, defined in the Constants class.
See Also:
Constants

getNodeName

public String getNodeName()
Return the node name.

Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class ElemTemplateElement
Returns:
The node name

replaceTemplate

public void replaceTemplate(ElemTemplate v,
                            int i)
                     throws javax.xml.transform.TransformerException
Replace an "xsl:template" property. This is a hook for CompilingStylesheetHandler, to allow us to access a template, compile it, instantiate it, and replace the original with the compiled instance. ADDED 9/5/2000 to support compilation experiment

Parameters:
v - Compiled template to replace with
i - Index of template to be replaced
Throws:
javax.xml.transform.TransformerException

callChildVisitors

protected void callChildVisitors(XSLTVisitor visitor,
                                 boolean callAttrs)
Call the children visitors.

Overrides:
callChildVisitors in class ElemTemplateElement
Parameters:
visitor - The visitor whose appropriate method will be called.

accept

protected boolean accept(XSLTVisitor visitor)
Accept a visitor and call the appropriate method for this class.

Overrides:
accept in class ElemTemplateElement
Parameters:
visitor - The visitor whose appropriate method will be called.
Returns:
true if the children of the object should be visited.