|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.utils.UnImplNode org.apache.xalan.templates.ElemTemplateElement org.apache.xalan.templates.Stylesheet org.apache.xalan.templates.StylesheetComposed org.apache.xalan.templates.StylesheetRoot
public class StylesheetRoot
This class represents the root object of the stylesheet tree.
Nested Class Summary | |
---|---|
(package private) class |
StylesheetRoot.ComposeState
Class to track state global state during the compose() operation. |
Field Summary | |
---|---|
private java.util.HashMap |
m_attrSets
Composed set of all included and imported attribute set properties. |
private java.util.HashMap |
m_availElems
The schema used when creating this StylesheetRoot |
private StylesheetRoot.ComposeState |
m_composeState
|
private java.util.Hashtable |
m_decimalFormatSymbols
Table of DecimalFormatSymbols, keyed by QName. |
private ElemTemplate |
m_defaultRootRule
The default template to use for the root if we don't find anything else. |
private ElemTemplate |
m_defaultRule
The default template to use if we don't find anything else. |
private ElemTemplate |
m_defaultTextRule
The default template to use for text nodes if we don't find anything else. |
private java.lang.String |
m_extensionHandlerClass
|
private ExtensionNamespacesManager |
m_extNsMgr
|
private StylesheetComposed[] |
m_globalImportList
The combined list of imports. |
private boolean |
m_incremental
The flag for the setting of the incremental feature; |
private boolean |
m_isSecureProcessing
State of the secure processing feature. |
private java.util.Vector |
m_keyDecls
A list of all key declarations visible from this stylesheet and all lesser stylesheets. |
private java.util.Hashtable |
m_namespaceAliasComposed
Composed set of all namespace aliases. |
private boolean |
m_optimizer
The flag for the setting of the optimize feature; |
private boolean |
m_outputMethodSet
Flag indicating whether an output method has been set by the user. |
private OutputProperties |
m_outputProperties
This will be set up with the default values, and then the values will be set as stylesheets are encountered. |
(package private) XPath |
m_selectDefault
Used for default selection. |
private boolean |
m_source_location
The flag for the setting of the source_location feature; |
private ElemTemplate |
m_startRule
The start rule to kick off the transformation. |
private TemplateList |
m_templateList
The "xsl:template" properties. |
private java.util.Vector |
m_variables
Composed set of all variables and params. |
private TemplateList |
m_whiteSpaceInfoList
A list of properties that specify how to do space stripping. |
(package private) static long |
serialVersionUID
|
Fields inherited from class org.apache.xalan.templates.Stylesheet |
---|
m_DecimalFormatDeclarations, STYLESHEET_EXT |
Fields inherited from class org.apache.xalan.templates.ElemTemplateElement |
---|
m_docOrderNumber, m_firstChild, m_hasVariableDecl, m_nextSibling, m_parentNode |
Fields inherited from class org.apache.xml.utils.UnImplNode |
---|
actualEncoding, fDocumentURI |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
StylesheetRoot(javax.xml.transform.ErrorListener errorListener)
Uses an XSL stylesheet document. |
|
StylesheetRoot(XSLTSchema schema,
javax.xml.transform.ErrorListener listener)
Creates a StylesheetRoot and retains a pointer to the schema used to create this StylesheetRoot. |
Method Summary | |
---|---|
protected void |
addImports(Stylesheet stylesheet,
boolean addToList,
java.util.Vector importList)
Add the imports in the given sheet to the working importList vector. |
boolean |
canStripWhiteSpace()
Get information about whether or not whitespace can be stripped. |
private void |
clearComposeState()
Clear the compose state. |
(package private) void |
composeTemplates(ElemTemplateElement templ)
Call the compose function for each ElemTemplateElement. |
java.util.ArrayList |
getAttributeSetComposed(QName name)
Get a list "xsl:attribute-set" properties that match the qname. |
java.util.HashMap |
getAvailableElements()
Get the hashtable of available elements. |
(package private) StylesheetRoot.ComposeState |
getComposeState()
Return class to track state global state during the compose() operation. |
java.text.DecimalFormatSymbols |
getDecimalFormatComposed(QName name)
Given a valid element decimal-format name, return the decimalFormatSymbols with that name. |
java.util.Properties |
getDefaultOutputProps()
|
ElemTemplate |
getDefaultRootRule()
Get the default template for a root node. |
ElemTemplate |
getDefaultRule()
Get the default template for elements. |
ElemTemplate |
getDefaultTextRule()
Get the default template for text. |
java.lang.String |
getExtensionHandlerClass()
|
ExtensionNamespacesManager |
getExtensionNamespacesManager()
Only instantiate an ExtensionNamespacesManager if one is called for (i.e., if the stylesheet contains extension functions and/or elements). |
java.util.Vector |
getExtensions()
Get the vector of extension namespaces. |
StylesheetComposed |
getGlobalImport(int i)
Get a stylesheet from the global import list. |
int |
getGlobalImportCount()
Get the total number of imports in the global import list. |
int |
getImportNumber(StylesheetComposed sheet)
Given a stylesheet, return the number of the stylesheet in the global import list. |
boolean |
getIncremental()
|
java.util.Vector |
getKeysComposed()
Get the composed "xsl:key" properties. |
NamespaceAlias |
getNamespaceAliasComposed(java.lang.String uri)
Get the "xsl:namespace-alias" property. |
boolean |
getOptimizer()
|
OutputProperties |
getOutputComposed()
Get the combined "xsl:output" property with the properties combined from the included stylesheets. |
java.util.Properties |
getOutputProperties()
Get the static properties for xsl:output. |
boolean |
getSource_location()
|
ElemTemplate |
getStartRule()
Get the default template for a root node. |
ElemTemplate |
getTemplateComposed(QName qname)
Get an "xsl:template" property. |
ElemTemplate |
getTemplateComposed(XPathContext xctxt,
int targetNode,
QName mode,
boolean quietConflictWarnings,
DTM dtm)
Get an "xsl:template" property by node match. |
ElemTemplate |
getTemplateComposed(XPathContext xctxt,
int targetNode,
QName mode,
int maxImportLevel,
int endImportLevel,
boolean quietConflictWarnings,
DTM dtm)
Get an "xsl:template" property by node match. |
TemplateList |
getTemplateListComposed()
Accessor method to retrieve the TemplateList associated with
this StylesheetRoot. |
ElemVariable |
getVariableOrParamComposed(QName qname)
Get an "xsl:variable" property. |
java.util.Vector |
getVariablesAndParamsComposed()
Get all global "xsl:variable" properties in scope for this stylesheet. |
WhiteSpaceInfo |
getWhiteSpaceInfo(XPathContext support,
int targetElement,
DTM dtm)
Get information about whether or not an element should strip whitespace. |
(package private) void |
initComposeState()
Initialize a new ComposeState. |
private void |
initDefaultRule(javax.xml.transform.ErrorListener errorListener)
Create the default rule if needed. |
boolean |
isOutputMethodSet()
Find out if an output method has been set by the user. |
boolean |
isRoot()
Tell if this is the root of the stylesheet tree. |
boolean |
isSecureProcessing()
Return the state of the secure processing feature. |
javax.xml.transform.Transformer |
newTransformer()
Create a new transformation context for this Templates object. |
private void |
QuickSort2(java.util.Vector v,
int lo0,
int hi0)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
void |
recompose()
Recompose the values of all "composed" properties, meaning properties that need to be combined or calculated from the combination of imported and included stylesheets. |
(package private) void |
recomposeAttributeSets(ElemAttributeSet attrSet)
Recompose the attribute-set declarations. |
(package private) void |
recomposeDecimalFormats(DecimalFormatProperties dfp)
Recompose the decimal-format declarations. |
(package private) void |
recomposeKeys(KeyDeclaration keyDecl)
Recompose the key declarations. |
(package private) void |
recomposeNamespaceAliases(NamespaceAlias nsAlias)
Recompose the namespace-alias declarations. |
(package private) void |
recomposeOutput(OutputProperties oprops)
Recompose the output format object from the included elements. |
(package private) void |
recomposeTemplates(ElemTemplate template)
Recompose the template declarations. |
(package private) void |
recomposeVariables(ElemVariable elemVar)
Recompose the top level variable and parameter declarations. |
(package private) void |
recomposeWhiteSpaceInfo(WhiteSpaceInfo wsi)
Recompose the strip-space and preserve-space declarations. |
java.lang.String |
setExtensionHandlerClass(java.lang.String handlerClassName)
This internal method allows the setting of the java class to handle the extension function (if other than the default one). |
void |
setIncremental(boolean b)
|
void |
setOptimizer(boolean b)
|
void |
setSecureProcessing(boolean flag)
Set the state of the secure processing feature. |
void |
setSource_location(boolean b)
|
void |
setTemplateListComposed(TemplateList templateList)
Mutator method to set the TemplateList associated with this
StylesheetRoot. |
boolean |
shouldCheckWhitespace()
Check to see if the caller should bother with check for whitespace nodes. |
boolean |
shouldStripWhiteSpace(XPathContext support,
int targetElement)
Get information about whether or not an element should strip whitespace. |
Methods inherited from class org.apache.xalan.templates.StylesheetComposed |
---|
getEndImportCountComposed, getImportComposed, getImportCountComposed, getIncludeComposed, getIncludeCountComposed, isAggregatedType, recompose, recomposeImports, recomposeIncludes, recomposeTemplates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private boolean m_optimizer
private boolean m_incremental
private boolean m_source_location
private boolean m_isSecureProcessing
private java.util.HashMap m_availElems
private transient ExtensionNamespacesManager m_extNsMgr
private StylesheetComposed[] m_globalImportList
private OutputProperties m_outputProperties
private boolean m_outputMethodSet
private java.util.HashMap m_attrSets
private java.util.Hashtable m_decimalFormatSymbols
private java.util.Vector m_keyDecls
private java.util.Hashtable m_namespaceAliasComposed
private TemplateList m_templateList
private java.util.Vector m_variables
private TemplateList m_whiteSpaceInfoList
private ElemTemplate m_defaultTextRule
private ElemTemplate m_defaultRule
private ElemTemplate m_defaultRootRule
private ElemTemplate m_startRule
XPath m_selectDefault
private transient StylesheetRoot.ComposeState m_composeState
private java.lang.String m_extensionHandlerClass
Constructor Detail |
---|
public StylesheetRoot(javax.xml.transform.ErrorListener errorListener) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if the baseIdentifier can not be resolved to a URL.public StylesheetRoot(XSLTSchema schema, javax.xml.transform.ErrorListener listener) throws javax.xml.transform.TransformerConfigurationException
schema
- The schema used to create this stylesheet
javax.xml.transform.TransformerConfigurationException
- if the baseIdentifier can not be resolved to a URL.Method Detail |
---|
public boolean isRoot()
isRoot
in class Stylesheet
public void setSecureProcessing(boolean flag)
public boolean isSecureProcessing()
public java.util.HashMap getAvailableElements()
public ExtensionNamespacesManager getExtensionNamespacesManager()
public java.util.Vector getExtensions()
public javax.xml.transform.Transformer newTransformer()
newTransformer
in interface javax.xml.transform.Templates
public java.util.Properties getDefaultOutputProps()
public java.util.Properties getOutputProperties()
For XSLT, Attribute Value Templates attribute values will be returned unexpanded (since there is no context at this point).
getOutputProperties
in interface javax.xml.transform.Templates
public void recompose() throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
void composeTemplates(ElemTemplateElement templ) throws javax.xml.transform.TransformerException
templ
- non-null reference to template element that will have
the composed method called on it, and will have it's children's composed
methods called.
javax.xml.transform.TransformerException
protected void addImports(Stylesheet stylesheet, boolean addToList, java.util.Vector importList)
For example, suppose
stylesheet A imports stylesheets B and C in that order;
stylesheet B imports stylesheet D;
stylesheet C imports stylesheet E.
Then the order of import precedence (highest first) is A, C, E, B, D.
stylesheet
- Stylesheet to examine for imports.addToList
- true
if this template should be added to the import listimportList
- The working import list. Templates are added here in the reverse
order of priority. When we're all done, we'll reverse this to the correct
priority in an array.public StylesheetComposed getGlobalImport(int i)
i
- Index of stylesheet to get from global import list
public int getGlobalImportCount()
public int getImportNumber(StylesheetComposed sheet)
sheet
- The stylesheet which will be located in the
global import list.
void recomposeOutput(OutputProperties oprops) throws javax.xml.transform.TransformerException
oprops
- non-null reference to xsl:output properties representation.
javax.xml.transform.TransformerException
public OutputProperties getOutputComposed()
public boolean isOutputMethodSet()
void recomposeAttributeSets(ElemAttributeSet attrSet)
attrSet
- An attribute-set to add to the hashtable of attribute sets.public java.util.ArrayList getAttributeSetComposed(QName name) throws java.lang.ArrayIndexOutOfBoundsException
name
- Qualified name of attribute set properties to get
java.lang.ArrayIndexOutOfBoundsException
void recomposeDecimalFormats(DecimalFormatProperties dfp)
dfp
- A DecimalFormatProperties to add to the hashtable of decimal formats.public java.text.DecimalFormatSymbols getDecimalFormatComposed(QName name)
It is an error to declare either the default decimal-format or a decimal-format with a given name more than once (even with different import precedence), unless it is declared every time with the same value for all attributes (taking into account any default values).
Which means, as far as I can tell, the decimal-format properties are not additive.
name
- Qualified name of the decimal format to find
void recomposeKeys(KeyDeclaration keyDecl)
keyDecl
- A KeyDeclaration to be added to the vector of key declarations.public java.util.Vector getKeysComposed()
void recomposeNamespaceAliases(NamespaceAlias nsAlias)
nsAlias
- A NamespaceAlias object to add to the hashtable of namespace aliases.public NamespaceAlias getNamespaceAliasComposed(java.lang.String uri)
uri
- non-null reference to namespace that is to be aliased.
void recomposeTemplates(ElemTemplate template)
template
- An ElemTemplate object to add to the template list.public final TemplateList getTemplateListComposed()
TemplateList
associated with
this StylesheetRoot.
TemplateList
.public final void setTemplateListComposed(TemplateList templateList)
TemplateList
associated with this
StylesheetRoot. This method should only be used by the compiler. Normally,
the template list is built during the recompose process and should not be
altered by the user.
templateList
- The new TemplateList
for this StylesheetRoot.public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, boolean quietConflictWarnings, DTM dtm) throws javax.xml.transform.TransformerException
xctxt
- non-null reference to XPath runtime execution context.targetNode
- non-null reference of node that the template must match.mode
- qualified name of the node, or null.quietConflictWarnings
- true if conflict warnings should not be reported.
javax.xml.transform.TransformerException
public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, int maxImportLevel, int endImportLevel, boolean quietConflictWarnings, DTM dtm) throws javax.xml.transform.TransformerException
xctxt
- non-null reference to XPath runtime execution context.targetNode
- non-null reference of node that the template must match.mode
- qualified name of the node, or null.maxImportLevel
- The maximum importCountComposed that we should consider or -1
if we should consider all import levels. This is used by apply-imports to
access templates that have been overridden.endImportLevel
- The count of composed importsquietConflictWarnings
- true if conflict warnings should not be reported.
javax.xml.transform.TransformerException
public ElemTemplate getTemplateComposed(QName qname)
qname
- non-null reference to qualified name of template.
void recomposeVariables(ElemVariable elemVar)
elemVar
- A top level variable or parameter to be added to the Vector.public ElemVariable getVariableOrParamComposed(QName qname)
qname
- Qualified name of variable or param
public java.util.Vector getVariablesAndParamsComposed()
void recomposeWhiteSpaceInfo(WhiteSpaceInfo wsi)
wsi
- A WhiteSpaceInfo element to add to the list of WhiteSpaceInfo elements.public boolean shouldCheckWhitespace()
public WhiteSpaceInfo getWhiteSpaceInfo(XPathContext support, int targetElement, DTM dtm) throws javax.xml.transform.TransformerException
support
- The XPath runtime state.targetElement
- Element to check
javax.xml.transform.TransformerException
public boolean shouldStripWhiteSpace(XPathContext support, int targetElement) throws javax.xml.transform.TransformerException
support
- The XPath runtime state.targetElement
- Element to check
javax.xml.transform.TransformerException
public boolean canStripWhiteSpace()
canStripWhiteSpace
in interface WhitespaceStrippingElementMatcher
canStripWhiteSpace
in class ElemTemplateElement
public final ElemTemplate getDefaultTextRule()
public final ElemTemplate getDefaultRule()
public final ElemTemplate getDefaultRootRule()
public final ElemTemplate getStartRule()
private void initDefaultRule(javax.xml.transform.ErrorListener errorListener) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
private void QuickSort2(java.util.Vector v, int lo0, int hi0)
v
- a vector of ElemTemplateElement elementslo0
- left boundary of partitionhi0
- right boundary of partitionvoid initComposeState()
StylesheetRoot.ComposeState getComposeState()
private void clearComposeState()
public java.lang.String setExtensionHandlerClass(java.lang.String handlerClassName)
public java.lang.String getExtensionHandlerClass()
public boolean getOptimizer()
public void setOptimizer(boolean b)
b
- Optimization flagpublic boolean getIncremental()
public boolean getSource_location()
public void setIncremental(boolean b)
b
- Incremental flagpublic void setSource_location(boolean b)
b
- Source location flag
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |