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
-
QUOTE
-
-
XMLNS_ATTR
-
-
XMLNS_DECL
-
-
XSL_NAMESPACE
-
-
XSLStylesheet()
- Create a new XSLStylesheet
-
addAttributeSet(AttributeSet)
- Adds the given AttributeSet to this stylesheet
-
addId(Id)
- Adds a new Id for the specified element type to the list of
IDs for this element type stylesheet.
-
addId(String)
- Adds a new Id to the list of IDs for this stylesheet for all elements.
-
addId(String, String)
- Adds a new Id for the specified element type to the list of
IDs for this element type stylesheet.
-
addPI(ProcessingInstruction)
- Adds the ProcessingInstruction to this Stylesheet.
-
addScript(XSLScript)
- Adds a new global level XSLScript to this stylesheet.
-
addTemplate(TemplateRule)
- Adds a new TemplateRule to the list of rules for this stylesheet.
-
addVariable(Variable)
- Adds a new string constant to the list of defined constants
for this stylesheet.
-
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
-
countTemplates()
-
-
getAttributeSet(String)
-
-
getAttributeSets()
- Returns all of the attribute-sets for this stylesheet
-
getDocumentBase()
- Returns the document base for this stylesheet
-
getHref()
-
-
getIds()
-
-
getLocalTemplates()
-
-
getNamedTemplate(String)
- Returns the TemplateRule whose name matches the given name argument.
-
getNamedTemplates()
- Returns an enumeration of templates that have names
-
getQuotedNamespace(String)
- Returns the namespace that the given namespace argument
quotes
-
getResultDocType()
-
-
getResultNamespace()
-
-
getScripts()
- Retrieves the set of global level scripts for this stylesheet
-
getTemplates()
-
-
getVariableDecl(String)
-
-
getVariables()
- Retrieves the set of global variables for this stylesheet
-
getXSLNSPrefix()
- Returns the XSL Namespace Prefix for this XSL Stylesheet
-
importFrom(XSLImport)
- Imports the XSLStylesheet referenced by the given XSLImport
to this stylesheet.
-
importFrom(XSLStylesheet)
- Imports the given XSLStylesheet to this XSLStylesheet.
-
includeFrom(XSLStylesheet)
- Includes the given XSLStylesheet to this XSLStylesheet.
-
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.
-
isStripSpaceAllowed(String)
- Determines whether or not whitespace stripping is allowed
for Elements with the given name
-
preserveSpace(String)
- Preserves the whitespace of Elements with the given name.
-
setAttribute(String, String)
-
-
setDocumentBase(String)
- Sets the Document Base for this stylesheet
-
setHref(String)
- Sets the href for this stylesheet
-
stripSpace(String)
- Removes the ignorable whitespace from Elements with the given name.
XSL_NAMESPACE
public static final String XSL_NAMESPACE
XMLNS_DECL
public static final String XMLNS_DECL
XMLNS_ATTR
public static final String XMLNS_ATTR
QUOTE
public static final String QUOTE
XSLStylesheet
public XSLStylesheet()
- Create a new XSLStylesheet
addAttributeSet
public void addAttributeSet(AttributeSet attributeSet)
- Adds the given AttributeSet to this stylesheet
- Parameters:
- attributeSet - the AttributeSet to add
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
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
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
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
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
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
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
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
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
getAttributeSets
public Hashtable getAttributeSets()
- Returns all of the attribute-sets for this stylesheet
- Returns:
- all of the AttributeSets for this stylesheet
getVariables
public Hashtable getVariables()
- Retrieves the set of global variables for this stylesheet
- Returns:
- the Hashtable of variables
getVariableDecl
public Variable getVariableDecl(String name)
getDocumentBase
public String getDocumentBase()
- Returns the document base for this stylesheet
- Returns:
- the document base for this stylesheet
getHref
public String getHref()
- Returns:
- the href for this stylesheet
getIds
public Hashtable getIds()
- Returns:
- a Vector of all the ID attributes for this Stylesheet
getLocalTemplates
public List getLocalTemplates()
- Returns:
- a Vector of the TemplateRule objects for this
stylesheet, does not include imported TemplateRules.
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
getNamedTemplates
public Enumeration getNamedTemplates()
- Returns an enumeration of templates that have names
- Returns:
- an enumeration of templates that have names
countTemplates
public int countTemplates()
- Returns:
- the number of templates contained in this stylesheet,
including imported rules
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.
getResultNamespace
public String getResultNamespace()
getResultDocType
public String getResultDocType()
getScripts
public List getScripts()
- Retrieves the set of global level scripts for this stylesheet
- Returns:
- a List of XSLScript Objects
getTemplates
public TemplateRule[] getTemplates()
- Returns:
- an array of all the TemplateRule objects for this
stylesheet, including imported templates
getXSLNSPrefix
public String getXSLNSPrefix()
- Returns the XSL Namespace Prefix for this XSL Stylesheet
- Returns:
- the XSL Namespace Prefix for this XSL Stylesheet
importFrom
public void importFrom(XSLStylesheet xsl) throws XSLException
- Imports the given XSLStylesheet to this XSLStylesheet.
- Parameters:
- xsl - the XSLStylesheet to import
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.
includeFrom
public void includeFrom(XSLStylesheet xsl) throws XSLException
- Includes the given XSLStylesheet to this XSLStylesheet.
- Parameters:
- xsl - the XSLStylesheet to include
- See Also:
- isAllowableInclusion
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.
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
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
setAttribute
public void setAttribute(String name,
String value) throws XSLException
- Overrides:
- setAttribute in class XSLObject
- See Also:
- XSLElement
setDocumentBase
public void setDocumentBase(String documentBase)
- Sets the Document Base for this stylesheet
- Parameters:
- documentBase - the document base to set this stylesheet to.
setHref
public void setHref(String href)
- Sets the href for this stylesheet
- Parameters:
- href - the href to set this stylesheet's href to
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