org.apache.xalan.templates
Class Stylesheet

java.lang.Object
  |
  +--org.apache.xalan.utils.UnImplNode
        |
        +--org.apache.xalan.templates.ElemTemplateElement
              |
              +--org.apache.xalan.templates.Stylesheet
Direct Known Subclasses:
StylesheetComposed

public class Stylesheet
extends ElemTemplateElement
implements java.io.Serializable, Document

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
static java.lang.String STYLESHEET_EXT
          Extension to be used when serializing to disk.
 
Constructor Summary
Stylesheet(Stylesheet parent)
          Constructor for a Stylesheet.
 
Method Summary
 boolean containsExcludeResultPrefix(java.lang.String prefix)
          Get whether or not the passed URL is contained flagged by the "extension-element-prefixes" property.
 boolean containsExtensionElementURI(java.lang.String uri)
          Get and "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.
 java.lang.String getExcludeResultPrefix(int i)
          Get an "exclude-result-prefix" property.
 int getExcludeResultPrefixCount()
          Get the number of "extension-element-prefixes" Strings.
 java.lang.String getExtensionElementPrefix(int i)
          Get and "extension-element-prefix" property.
 int getExtensionElementPrefixCount()
          Get the number of "extension-element-prefixes" Strings.
 java.lang.String getHref()
          Get the base identifier with which this stylesheet is associated.
 java.lang.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 an "xsl:include" property.
 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:variable" property.
 int getNamespaceAliasCount()
          Get the number of "xsl:variable" properties.
 java.lang.String getNodeName()
          Return the node name.
 short getNodeType()
          Get the type of the node.
 java.lang.Object getNonXslTopLevel(QName name)
          Get a non-xslt element.
 OutputFormatExtended getOutput()
          Get the "xsl:output" property.
 ElemParam getParam(int i)
          Get an "xsl:param" property.
 ElemParam getParam(QName qname)
          Get an "xsl:param" property.
 int getParamCount()
          Get the number of "xsl:param" properties.
 XPath getPreserveSpace(int i)
          Get a "xsl:preserve-space" property.
 int getPreserveSpaceCount()
          Get the number of "xsl:preserve-space" properties.
 XPath 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(int i)
          Get an "xsl:variable" property.
 ElemVariable getVariable(QName qname)
          Get an "xsl:variable" property.
 int getVariableCount()
          Get the number of "xsl:variable" properties.
 java.lang.String getVersion()
          Get the "version" property.
 java.lang.String getXmlnsXsl()
          Get the "xmlns:xsl" property.
 boolean getXmlSpace()
          Get the "xml:space" 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.
 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(java.lang.String baseIdent)
          Get the base identifier with which this stylesheet is associated.
 void setId(java.lang.String v)
          Set the "id" property.
 void setImport(StylesheetComposed v)
          Add a stylesheet to the "import" list.
 void setInclude(Stylesheet v)
          Set a "xsl:include" property.
 void setKey(KeyDeclaration v)
          Set the "xsl:key" property.
 void setLocaterInfo(Locator locator)
          Set the location information for this element.
 void setNamespaceAlias(NamespaceAlias na)
          Set the "xsl:namespace-alias" property.
 void setNonXslTopLevel(QName name, java.lang.Object obj)
          Set a found non-xslt element.
 void setOutput(OutputFormatExtended v)
          Set the "xsl:output" property.
 void setParam(ElemParam v)
          Set an "xsl:param" property.
 void setPreserveSpaces(java.util.Vector v)
          Set the "xsl:preserve-space" property.
 void setStripSpaces(java.util.Vector v)
          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(java.lang.String v)
          Set the "version" property.
 void setXmlnsXsl(java.lang.String v)
          Set the "xmlns:xsl" property.
 void setXmlSpace(boolean v)
          Set the "xml:space" property.
 
Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, compose, error, execute, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getFirstChild, getFirstChildElem, getLastChild, getLength, getLineNumber, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getOwnerDocument, getParentElem, getParentNode, getPrefixes, getPreviousSibling, getPublicId, getSystemId, getTagName, hasChildNodes, isCompiledTemplate, item, removeChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setPrefixes, setPrefixes
 
Methods inherited from class org.apache.xalan.utils.UnImplNode
appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLocalName, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSpecified, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceData, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData, supports
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLESHEET_EXT

public static final java.lang.String STYLESHEET_EXT
Extension to be used when serializing to disk.
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

isAggregatedType

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

isRoot

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

setXmlnsXsl

public void setXmlnsXsl(java.lang.String v)
Set the "xmlns:xsl" property.
See Also:
xslt-namespace in XSLT Specification

getXmlnsXsl

public java.lang.String getXmlnsXsl()
Get the "xmlns:xsl" property.
See Also:
xslt-namespace in XSLT Specification

setExtensionElementPrefixes

public void setExtensionElementPrefixes(StringVector v)
Set the "extension-element-prefixes" property.
See Also:
extension-element in XSLT Specification

getExtensionElementPrefix

public java.lang.String getExtensionElementPrefix(int i)
                                           throws java.lang.ArrayIndexOutOfBoundsException
Get and "extension-element-prefix" property.
See Also:
extension-element in XSLT Specification

getExtensionElementPrefixCount

public int getExtensionElementPrefixCount()
Get the number of "extension-element-prefixes" Strings.
See Also:
extension-element in XSLT Specification

containsExtensionElementURI

public boolean containsExtensionElementURI(java.lang.String uri)
Get and "extension-element-prefix" property.
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.
See Also:
literal-result-element in XSLT Specification

getExcludeResultPrefix

public java.lang.String getExcludeResultPrefix(int i)
                                        throws java.lang.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.
See Also:
literal-result-element in XSLT Specification

getExcludeResultPrefixCount

public int getExcludeResultPrefixCount()
Get the number of "extension-element-prefixes" Strings.
See Also:
extension-element in XSLT Specification

containsExcludeResultPrefix

public boolean containsExcludeResultPrefix(java.lang.String prefix)
Get whether or not the passed URL is contained flagged by the "extension-element-prefixes" property.
See Also:
extension-element in XSLT Specification

setId

public void setId(java.lang.String v)
Set the "id" property.
See Also:
section-Embedding-Stylesheets in XSLT Specification

getId

public java.lang.String getId()
Get the "id" property.
See Also:
section-Embedding-Stylesheets in XSLT Specification

setVersion

public void setVersion(java.lang.String v)
Set the "version" property.
See Also:
forwards in XSLT Specification

getVersion

public java.lang.String getVersion()
Get the "version" property.
See Also:
forwards in XSLT Specification

setXmlSpace

public void setXmlSpace(boolean v)
Set the "xml:space" property.
Overrides:
setXmlSpace in class ElemTemplateElement
See Also:
strip in XSLT Specification

getXmlSpace

public boolean getXmlSpace()
Get the "xml:space" property.
Overrides:
getXmlSpace in class ElemTemplateElement
See Also:
strip in XSLT Specification

setImport

public void setImport(StylesheetComposed v)
Add a stylesheet to the "import" list.
See Also:
import in XSLT Specification

getImport

public StylesheetComposed getImport(int i)
                             throws java.lang.ArrayIndexOutOfBoundsException
Get a stylesheet from the "import" list.
See Also:
import in XSLT Specification

getImportCount

public int getImportCount()
Get the number of imported stylesheets.
See Also:
import in XSLT Specification

setInclude

public void setInclude(Stylesheet v)
Set a "xsl:include" property.
See Also:
include in XSLT Specification

getInclude

public Stylesheet getInclude(int i)
                      throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:include" property.
See Also:
include in XSLT Specification

getIncludeCount

public int getIncludeCount()
Get the number of included stylesheets.
See Also:
import in XSLT Specification

setDecimalFormat

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

getDecimalFormat

public DecimalFormatProperties getDecimalFormat(QName name)
Get an "xsl:decimal-format" property.
Returns:
null if not found, otherwise a DecimalFormatProperties object, from which you can get a DecimalFormatSymbols object.
See Also:
ElemDecimalFormat., format-number in XSLT Specification

getDecimalFormat

public DecimalFormatProperties getDecimalFormat(int i)
                                         throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:decimal-format" property.
See Also:
format-number in XSLT Specification, ElemDecimalFormat.

getDecimalFormatCount

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

setStripSpaces

public void setStripSpaces(java.util.Vector v)
Set the "xsl:strip-space" properties.
See Also:
strip in XSLT Specification

getStripSpace

public XPath getStripSpace(int i)
                    throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:strip-space" property.
See Also:
strip in XSLT Specification

getStripSpaceCount

public int getStripSpaceCount()
Get the number of "xsl:strip-space" properties.
See Also:
strip in XSLT Specification

setPreserveSpaces

public void setPreserveSpaces(java.util.Vector v)
Set the "xsl:preserve-space" property.
See Also:
strip in XSLT Specification

getPreserveSpace

public XPath getPreserveSpace(int i)
                       throws java.lang.ArrayIndexOutOfBoundsException
Get a "xsl:preserve-space" property.
See Also:
strip in XSLT Specification

getPreserveSpaceCount

public int getPreserveSpaceCount()
Get the number of "xsl:preserve-space" properties.
See Also:
strip in XSLT Specification

setOutput

public void setOutput(OutputFormatExtended v)
Set the "xsl:output" property.
See Also:
output in XSLT Specification

getOutput

public OutputFormatExtended getOutput()
Get the "xsl:output" property.
See Also:
output in XSLT Specification

setKey

public void setKey(KeyDeclaration v)
Set the "xsl:key" property.
See Also:
key in XSLT Specification

getKey

public KeyDeclaration getKey(int i)
                      throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:key" property.
See Also:
key in XSLT Specification

getKeyCount

public int getKeyCount()
Get the number of "xsl:key" properties.
See Also:
key in XSLT Specification

setAttributeSet

public void setAttributeSet(ElemAttributeSet attrSet)
Set the "xsl:attribute-set" property.
See Also:
attribute-sets in XSLT Specification

getAttributeSet

public ElemAttributeSet getAttributeSet(int i)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:attribute-set" property.
See Also:
attribute-sets in XSLT Specification

getAttributeSetCount

public int getAttributeSetCount()
Get 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.
See Also:
top-level-variables in XSLT Specification

getVariable

public ElemVariable getVariable(QName qname)
Get an "xsl:variable" property.
See Also:
top-level-variables in XSLT Specification

getVariable

public ElemVariable getVariable(int i)
                         throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:variable" property.
See Also:
top-level-variables in XSLT Specification

getVariableCount

public int getVariableCount()
Get 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.
See Also:
top-level-variables in XSLT Specification

getParam

public ElemParam getParam(QName qname)
Get an "xsl:param" property.
See Also:
top-level-variables in XSLT Specification

getParam

public ElemParam getParam(int i)
                   throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:param" property.
See Also:
top-level-variables in XSLT Specification

getParamCount

public int getParamCount()
Get the number of "xsl:param" properties.
See Also:
top-level-variables in XSLT Specification

setTemplate

public void setTemplate(ElemTemplate v)
Set an "xsl:template" property.
See Also:
section-Defining-Template-Rules in XSLT Specification

getTemplate

public ElemTemplate getTemplate(int i)
                         throws SAXException
Get an "xsl:template" property.
See Also:
section-Defining-Template-Rules in XSLT Specification

getTemplateCount

public int getTemplateCount()
Get 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.
See Also:
literal-result-element in XSLT Specification

getNamespaceAlias

public NamespaceAlias getNamespaceAlias(int i)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Get an "xsl:variable" property.
See Also:
top-level-variables in XSLT Specification

getNamespaceAliasCount

public int getNamespaceAliasCount()
Get the number of "xsl:variable" properties.
See Also:
top-level-variables in XSLT Specification

setNonXslTopLevel

public void setNonXslTopLevel(QName name,
                              java.lang.Object obj)
Set a found non-xslt element.
See Also:
stylesheet-element in XSLT Specification

getNonXslTopLevel

public java.lang.Object getNonXslTopLevel(QName name)
Get a non-xslt element.
See Also:
stylesheet-element in XSLT Specification

getHref

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

setHref

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

setLocaterInfo

public void setLocaterInfo(Locator locator)
Set the location information for this element.
Overrides:
setLocaterInfo in class ElemTemplateElement

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

setStylesheetRoot

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

getStylesheetParent

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

setStylesheetParent

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

getStylesheetComposed

public StylesheetComposed getStylesheetComposed()
Get the owning aggregated stylesheet, or this stylesheet if it is aggregated.
Overrides:
getStylesheetComposed in class ElemTemplateElement

getNodeType

public short getNodeType()
Get the type of the node. We'll pretend we're a Document.
Overrides:
getNodeType in class ElemTemplateElement

getXSLToken

public int getXSLToken()
Get an integer representation of the element type.
Returns:
An integer representation of the element, defined in the Constants class.
Overrides:
getXSLToken in class ElemTemplateElement
See Also:
Constants

getNodeName

public java.lang.String getNodeName()
Return the node name.
Overrides:
getNodeName in class ElemTemplateElement

replaceTemplate

public void replaceTemplate(ElemTemplate v,
                            int i)
                     throws SAXException
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


Copyright © 2000 Apache XML Project. All Rights Reserved.