All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.kvisco.xsl.XSLStylesheet

com.kvisco.xsl.XSLObject
   |
   +----com.kvisco.xsl.XSLStylesheet

public class XSLStylesheet
extends XSLObject
This class represents an XSL stylesheet

Author:
Keith Visco

Variable Index

 o QUOTE
 o XMLNS_ATTR
 o XMLNS_DECL
 o XSL_NAMESPACE

Constructor Index

 o XSLStylesheet()
Create a new XSLStylesheet

Method Index

 o addAttributeSet(AttributeSet)
Adds the given AttributeSet to this stylesheet
 o addId(Id)
Adds a new Id for the specified element type to the list of IDs for this element type stylesheet.
 o addId(String)
Adds a new Id to the list of IDs for this stylesheet for all elements.
 o addId(String, String)
Adds a new Id for the specified element type to the list of IDs for this element type stylesheet.
 o addPI(ProcessingInstruction)
Adds the ProcessingInstruction to this Stylesheet.
 o addScript(XSLScript)
Adds a new global level XSLScript to this stylesheet.
 o addTemplate(TemplateRule)
Adds a new TemplateRule to the list of rules for this stylesheet.
 o addVariable(Variable)
Adds a new string constant to the list of defined constants for this stylesheet.
 o appendAction(XSLObject)
Adds the given XSLObject to this Stylesheet.
The following elements are valid:
   xsl:attribute-set
   xsl:constant
   xsl:id
   xsl:import
   xsl:include
   xsl:macro
   xsl:template
   xsl:preserve-space
   xsl:strip-space

 The following proprietary elemens are also valid:
   xsl:script
 

  
 o countTemplates()
 o getAttributeSet(String)
 o getAttributeSets()
Returns all of the attribute-sets for this stylesheet
 o getDocumentBase()
Returns the document base for this stylesheet
 o getHref()
 o getIds()
 o getLocalTemplates()
 o getNamedTemplate(String)
Returns the TemplateRule whose name matches the given name argument.
 o getNamedTemplates()
Returns an enumeration of templates that have names
 o getQuotedNamespace(String)
Returns the namespace that the given namespace argument quotes
 o getResultDocType()
 o getResultNamespace()
 o getScripts()
Retrieves the set of global level scripts for this stylesheet
 o getTemplates()
 o getVariableDecl(String)
 o getVariables()
Retrieves the set of global variables for this stylesheet
 o getXSLNSPrefix()
Returns the XSL Namespace Prefix for this XSL Stylesheet
 o importFrom(XSLImport)
Imports the XSLStylesheet referenced by the given XSLImport to this stylesheet.
 o importFrom(XSLStylesheet)
Imports the given XSLStylesheet to this XSLStylesheet.
 o includeFrom(XSLStylesheet)
Includes the given XSLStylesheet to this XSLStylesheet.
 o isAllowableImport(String)
Checks the given filename against this Stylesheet's href and previously imported stylesheets to determine if the file represented by the given filename can be imported in this stylesheet.
 o isStripSpaceAllowed(String)
Determines whether or not whitespace stripping is allowed for Elements with the given name
 o preserveSpace(String)
Preserves the whitespace of Elements with the given name.
 o setAttribute(String, String)
 o setDocumentBase(String)
Sets the Document Base for this stylesheet
 o setHref(String)
Sets the href for this stylesheet
 o stripSpace(String)
Removes the ignorable whitespace from Elements with the given name.

Variables

 o XSL_NAMESPACE
 public static final String XSL_NAMESPACE
 o XMLNS_DECL
 public static final String XMLNS_DECL
 o XMLNS_ATTR
 public static final String XMLNS_ATTR
 o QUOTE
 public static final String QUOTE

Constructors

 o XSLStylesheet
 public XSLStylesheet()
Create a new XSLStylesheet

Methods

 o addAttributeSet
 public void addAttributeSet(AttributeSet attributeSet)
Adds the given AttributeSet to this stylesheet

Parameters:
attributeSet - the AttributeSet to add
 o addVariable
 public void addVariable(Variable var) throws XSLException
Adds a new string constant to the list of defined constants for this stylesheet.

Parameters:
name - the name of the constant
value - the value of the constant
Throws: XSLException
when adding a constant with the same name as a previously declared constant
 o addId
 public void addId(String idAttr)
Adds a new Id to the list of IDs for this stylesheet for all elements.

Parameters:
idAttr - the id attribute to add
 o addId
 public void addId(String idAttr,
                   String elementType)
Adds a new Id for the specified element type to the list of IDs for this element type stylesheet.

Parameters:
idAttr - the ID to add
elementType - the tag name of the element that id is an ID for Note: the wild card "*" will match all element types
 o addId
 public void addId(Id id)
Adds a new Id for the specified element type to the list of IDs for this element type stylesheet.

Parameters:
id - the Id to add
 o addPI
 public boolean addPI(ProcessingInstruction pi)
Adds the ProcessingInstruction to this Stylesheet.
Note:Only certain processing intructions will be processed. Valid ProcessingInstructions targets are:
xsl:result-dtd

Parameters:
pi - the ProcessingInstruction to add to this XSLStylesheet.
Returns:
true if the ProcessingInstruction was valid for this XSLStylesheet
 o addTemplate
 public void addTemplate(TemplateRule template) throws XSLException
Adds a new TemplateRule to the list of rules for this stylesheet.

Parameters:
rule - the TemplateRule to add
Throws: XSLException
when a template already exists with the given name
 o addScript
 public void addScript(XSLScript script)
Adds a new global level XSLScript to this stylesheet.
Note: This is currently a proprietary feature

Parameters:
script - the XSLScript to add
 o appendAction
 public boolean appendAction(XSLObject xslObject)
Adds the given XSLObject to this Stylesheet.
The following elements are valid:
   xsl:attribute-set
   xsl:constant
   xsl:id
   xsl:import
   xsl:include
   xsl:macro
   xsl:template
   xsl:preserve-space
   xsl:strip-space
 The following proprietary elemens are also valid:
   xsl:script
 

Overrides:
appendAction in class XSLObject
 o getAttributeSet
 public AttributeSet getAttributeSet(String setName)
Parameters:
setName - the name of the attribute set to return
Returns:
the AttributeSet for the given name, or null if not found.
See Also:
AttributeSet
 o getAttributeSets
 public Hashtable getAttributeSets()
Returns all of the attribute-sets for this stylesheet

Returns:
all of the AttributeSets for this stylesheet
 o getVariables
 public Hashtable getVariables()
Retrieves the set of global variables for this stylesheet

Returns:
the Hashtable of variables
 o getVariableDecl
 public Variable getVariableDecl(String name)
 o getDocumentBase
 public String getDocumentBase()
Returns the document base for this stylesheet

Returns:
the document base for this stylesheet
 o getHref
 public String getHref()
Returns:
the href for this stylesheet
 o getIds
 public Hashtable getIds()
Returns:
a Vector of all the ID attributes for this Stylesheet
 o getLocalTemplates
 public List getLocalTemplates()
Returns:
a Vector of the TemplateRule objects for this stylesheet, does not include imported TemplateRules.
 o getNamedTemplate
 public TemplateRule getNamedTemplate(String name)
Returns the TemplateRule whose name matches the given name argument. Peter Ciuffetti. Added for WD-xslt-1990421

Parameters:
name - the name of the NamedTemplate to return
Returns:
the TemplateRule whose name matches the given name argument
 o getNamedTemplates
 public Enumeration getNamedTemplates()
Returns an enumeration of templates that have names

Returns:
an enumeration of templates that have names
 o countTemplates
 public int countTemplates()
Returns:
the number of templates contained in this stylesheet, including imported rules
 o getQuotedNamespace
 public String getQuotedNamespace(String namespace)
Returns the namespace that the given namespace argument quotes

Parameters:
namespace - the namespace to resolve
Returns:
s the resolved namespace or the given namespace if it does not quote any other namespaces.
 o getResultNamespace
 public String getResultNamespace()
 o getResultDocType
 public String getResultDocType()
 o getScripts
 public List getScripts()
Retrieves the set of global level scripts for this stylesheet

Returns:
a List of XSLScript Objects
 o getTemplates
 public TemplateRule[] getTemplates()
Returns:
an array of all the TemplateRule objects for this stylesheet, including imported templates
 o getXSLNSPrefix
 public String getXSLNSPrefix()
Returns the XSL Namespace Prefix for this XSL Stylesheet

Returns:
the XSL Namespace Prefix for this XSL Stylesheet
 o importFrom
 public void importFrom(XSLStylesheet xsl) throws XSLException
Imports the given XSLStylesheet to this XSLStylesheet.

Parameters:
xsl - the XSLStylesheet to import
 o importFrom
 public void importFrom(XSLImport xslImport) throws XSLException
Imports the XSLStylesheet referenced by the given XSLImport to this stylesheet.

Parameters:
xslImport - the XSLImport referencing the appropriate XSLStylesheet to import.
 o includeFrom
 public void includeFrom(XSLStylesheet xsl) throws XSLException
Includes the given XSLStylesheet to this XSLStylesheet.

Parameters:
xsl - the XSLStylesheet to include
See Also:
isAllowableInclusion
 o isAllowableImport
 public boolean isAllowableImport(String filename)
Checks the given filename against this Stylesheet's href and previously imported stylesheets to determine if the file represented by the given filename can be imported in this stylesheet.

Returns:
true if the given filename is allowed to be included in this XSLStylesheet, otherwise false.
 o isStripSpaceAllowed
 public boolean isStripSpaceAllowed(String name)
Determines whether or not whitespace stripping is allowed for Elements with the given name

Parameters:
name - the name of the Element
See Also:
preserveSpace, stripSpace
 o preserveSpace
 public void preserveSpace(String name)
Preserves the whitespace of Elements with the given name. By default all ignorable whitespace is removed for all Elements.

Parameters:
name - the name of the Element to preserve whitespace of.
See Also:
stripSpace
 o setAttribute
 public void setAttribute(String name,
                          String value) throws XSLException
Overrides:
setAttribute in class XSLObject
See Also:
XSLElement
 o setDocumentBase
 public void setDocumentBase(String documentBase)
Sets the Document Base for this stylesheet

Parameters:
documentBase - the document base to set this stylesheet to.
 o setHref
 public void setHref(String href)
Sets the href for this stylesheet

Parameters:
href - the href to set this stylesheet's href to
 o stripSpace
 public void stripSpace(String name)
Removes the ignorable whitespace from Elements with the given name. By default all ignorable whitespace is removed for all Elements. This method should only be called if preserveSpace was previously called with the same name argument.

Parameters:
name - the name of the Element to strip whitespace from
See Also:
preserveSpace

All Packages  Class Hierarchy  This Package  Previous  Next  Index