public final class XSLTemplate extends StyleElement implements StylesheetComponent
StyleElement.OnFailureACTION_COMPILE, ACTION_FIXUP, ACTION_OPTIMIZE, ACTION_PROCESS_ATTRIBUTES, ACTION_TYPECHECK, ACTION_VALIDATE, actionsCompleted, defaultCollationName, defaultMode, defaultXPathNamespace, expandText, extensionNamespaces, reportingCircumstances, staticContext, validationError, versionNODE_LETTERIS_DTD_TYPE, IS_NILLED| Constructor and Description |
|---|
XSLTemplate() |
| Modifier and Type | Method and Description |
|---|---|
void |
allocatePatternSlotNumbers()
Allocate slot numbers to any local variables declared within a predicate within the match pattern
|
void |
checkCompatibility(Component component)
Check the compatibility of this component with another component that it is overriding
|
void |
compileDeclaration(Compilation compilation,
ComponentDeclaration decl)
Compile: creates the executable form of the template
|
void |
compileTemplateRule(Compilation compilation,
Expression body,
ComponentDeclaration decl) |
void |
generateByteCode(Optimizer opt)
Generate byte code for the template (if appropriate)
|
NamedTemplate |
getActor()
Get the corresponding NamedTemplate object that results from the compilation of this
StylesheetComponent
|
java.util.Set<Mode> |
getApplicableModes()
Get the modes to which this template rule applies
|
NamedTemplate |
getCompiledNamedTemplate()
Get the compiled template
|
ItemType |
getContextItemTypeForTemplateRule() |
Pattern |
getMatch() |
StructuredQName[] |
getModeNames()
Return the list of mode names to which this template rule is applicable.
|
XSLLocalParam |
getParam(StructuredQName name) |
ItemType |
getRequiredContextItemType() |
SlotManager |
getSlotManager()
Get associated Procedure (for details of stack frame)
|
SymbolicName |
getSymbolicName()
Get the symbolic name of the component, that is, the combination of the component kind and
the qualified name
|
StructuredQName |
getTemplateName()
Return the name of this template.
|
java.util.Map<StructuredQName,TemplateRule> |
getTemplateRulesByMode() |
void |
index(ComponentDeclaration decl,
PrincipalStylesheetModule top)
Method supplied by declaration elements to add themselves to a stylesheet-level index
|
boolean |
isDeclaration()
Ask whether this node is a declaration, that is, a permitted child of xsl:stylesheet
(including xsl:include and xsl:import).
|
boolean |
isDeferredCompilation(Compilation compilation)
Ask whether the compilation of the template should be deferred
|
boolean |
isMayOmitContextItem() |
boolean |
isOmniMode()
Ask whether this is a template rule with mode="#all
|
protected boolean |
isPermittedChild(StyleElement child)
Specify that xsl:param and xsl:context-item are permitted children
|
protected boolean |
isWithinDeclaredStreamableConstruct() |
void |
jitCompile(Compilation compilation,
ComponentDeclaration decl)
Code executed when the template is first executed under JIT.
|
boolean |
markTailCalls()
Mark tail-recursive calls on templates and functions.
|
protected boolean |
mayContainParam()
Determine whether this type of element is allowed to contain an xsl:param element
|
boolean |
mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a template-body
|
void |
optimize(ComponentDeclaration declaration)
This method is a bit of a misnomer, because it does more than invoke optimization of the template body.
|
void |
prepareAttributes()
Set the attribute list for the element.
|
void |
processAllAttributes()
Process the attributes of this element and all its children
|
void |
register(ComponentDeclaration declaration)
Registers the template rule with each Mode that it belongs to.
|
void |
setCompilation(Compilation compilation) |
void |
setContextItemRequirements(ItemType type,
boolean mayBeOmitted,
boolean absentFocus)
Set the required context item type.
|
void |
validate(ComponentDeclaration decl)
Check that the stylesheet element is valid.
|
void |
validateSubtree(ComponentDeclaration decl,
boolean excludeStylesheet)
Recursive walk through the stylesheet to validate all nodes
|
allocateLocation, bindLocalVariable, bindVariable, checkEmpty, checkTopLevel, checkUnknownAttribute, compile, compileError, compileError, compileError, compileError, compileError, compileError, compileErrorInAttribute, compileSequenceConstructor, compileSequenceConstructor, compileWarning, compileWarning, compileWarning, fixupReferences, generateId, getAttributeValue, getBaseURI, getBindingInformation, getCompilation, getConfiguration, getContainingPackage, getContainingSlotManager, getDeclaredVisibility, getDefaultCollationName, getDefaultXPathNamespace, getNamespaceResolver, getObjectName, getPackageData, getPrincipalStylesheetModule, getProperties, getSchemaType, getStaticContext, getStaticContext, getTypeAnnotation, getUsedPackage, getVisibility, getWithParamInstructions, getXslOriginal, hasImplicitBinding, invalidAttribute, isExtensionAttributeAllowed, isExtensionNamespace, isInstruction, isSchemaAware, issueWarning, issueWarning, isTopLevel, makeAttributeValueTemplate, makeExpression, makeExpressionVisitor, makeQName, makeRetainedStaticContext, makeSequenceType, mayContainFallback, postValidate, processBooleanAttribute, processStandardAttributes, processVersionAttribute, reportAbsence, requireSyntaxExtensions, seesAvuncularVariables, setObjectName, setValidationError, substituteFor, typeCheck, typeCheck, validateChildren, validateValidationAttributeaddAttribute, addNamespace, addNamespace, attributes, copy, delete, fixupInsertedNamespaces, generateId, getAllNamespaces, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getLineNumber, getNodeKind, getNodeName, getRoot, getSchemaType, getSystemId, getURIForPrefix, initialise, isId, isIdref, isInScopeNamespace, isNilled, iteratePrefixes, removeAttribute, removeNamespace, removeTypeAnnotation, rename, replaceStringValue, setAttributeInfo, setAttributes, setLocation, setNamespaceMap, setNilled, setNodeName, setSystemId, setTypeAnnotationaddChild, children, compact, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, iterateChildren, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumberatomize, compareOrder, effectiveBooleanValue, equals, getDisplayName, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getRawParent, getSiblingPosition, getSuccessorElement, getTreeInfo, getURI, hasFingerprint, head, insertSiblings, isDeleted, iterateAxis, iterateAxis, newBuilder, replace, saveLocation, setRawParent, setSiblingPositionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchildren, equals, getGenre, getPublicId, hashCode, isSameNodeInfo, isStreamed, toShortStringgetLength, itemAt, iterate, reduce, subsequence, toGroundedValueasIterable, concatenate, containsNode, materializemakeRepeatablepublic NamedTemplate getActor()
getActor in interface StylesheetComponentpublic void setCompilation(Compilation compilation)
setCompilation in class StyleElementpublic boolean isDeclaration()
isDeclaration in class StyleElementpublic boolean isDeferredCompilation(Compilation compilation)
compilation - the compilationpublic boolean mayContainSequenceConstructor()
mayContainSequenceConstructor in class StyleElementprotected boolean mayContainParam()
StyleElementmayContainParam in class StyleElementprotected boolean isWithinDeclaredStreamableConstruct()
isWithinDeclaredStreamableConstruct in class StyleElementpublic void setContextItemRequirements(ItemType type, boolean mayBeOmitted, boolean absentFocus)
type - the required context item typemayBeOmitted - true if the context item may be absentabsentFocus - true if use=absent is specifiedprotected boolean isPermittedChild(StyleElement child)
isPermittedChild in class StyleElementchild - the child that may or may not be permittedpublic StructuredQName getTemplateName()
public SymbolicName getSymbolicName()
StylesheetComponentgetSymbolicName in interface StylesheetComponentpublic ItemType getRequiredContextItemType()
public boolean isMayOmitContextItem()
public void checkCompatibility(Component component)
StylesheetComponentcheckCompatibility in interface StylesheetComponentcomponent - the overridden componentpublic XSLLocalParam getParam(StructuredQName name)
public void prepareAttributes()
StyleElementprepareAttributes in class StyleElementpublic void processAllAttributes()
throws XPathException
StyleElementprocessAllAttributes in class StyleElementXPathException - in the event of a static error being detectedpublic StructuredQName[] getModeNames() throws XPathException
Mode.UNNAMED_MODE_NAME. The token #all translates to
Mode.OMNI_MODE.XPathException - if the attribute is invalid.public java.util.Set<Mode> getApplicableModes() throws XPathException
XPathException - should not happenpublic boolean isOmniMode()
throws XPathException
XPathExceptionpublic void validate(ComponentDeclaration decl) throws XPathException
StyleElementvalidate in class StyleElementdecl - the declaration to be validatedXPathException - if any error is found during validationpublic void validateSubtree(ComponentDeclaration decl, boolean excludeStylesheet) throws XPathException
StyleElementvalidateSubtree in class StyleElementdecl - the declaration to be validatedexcludeStylesheet - true if the XSLStylesheet element is to be excludedXPathException - if validation failspublic void index(ComponentDeclaration decl, PrincipalStylesheetModule top) throws XPathException
StyleElementindex in class StyleElementdecl - the Declaration being indexed. (This corresponds to the StyleElement object
except in cases where one module is imported several times with different precedence.)top - represents the outermost XSLStylesheet or XSLPackage elementXPathException - if any error is encounteredpublic boolean markTailCalls()
markTailCalls in class StyleElementpublic void compileDeclaration(Compilation compilation, ComponentDeclaration decl) throws XPathException
compileDeclaration in class StyleElementcompilation - the compilation episodedecl - the containing top-level declaration, for example xsl:function or xsl:templateXPathException - if compilation failspublic void compileTemplateRule(Compilation compilation, Expression body, ComponentDeclaration decl)
public void jitCompile(Compilation compilation, ComponentDeclaration decl) throws XPathException
compilation - the compilation episodedecl - the template rule declarationXPathException - if anything goes wrongpublic void register(ComponentDeclaration declaration) throws XPathException
declaration - Associates this template with a stylesheet module (in principle an xsl:template
element can be in a document that is imported more than once; these are separate declarations)XPathException - if a failure occurspublic void allocatePatternSlotNumbers()
public void optimize(ComponentDeclaration declaration) throws XPathException
optimize in interface StylesheetComponentdeclaration - Associates this template with a stylesheet module (in principle an xsl:template
element can be in a document that is imported more than once; these are separate declarations)XPathException - if errors are foundpublic ItemType getContextItemTypeForTemplateRule() throws XPathException
XPathExceptionpublic void generateByteCode(Optimizer opt) throws XPathException
generateByteCode in interface StylesheetComponentopt - the optimizerXPathException - if byte code generation failspublic SlotManager getSlotManager()
getSlotManager in interface StylesheetComponentpublic NamedTemplate getCompiledNamedTemplate()
public Pattern getMatch()
public java.util.Map<StructuredQName,TemplateRule> getTemplateRulesByMode()
Copyright (c) 2004-2021 Saxonica Limited. All rights reserved.