Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
net.sf.saxon.tree.NodeImpl
net.sf.saxon.tree.ParentNodeImpl
net.sf.saxon.tree.ElementImpl
net.sf.saxon.tree.ElementWithAttributes
net.sf.saxon.style.StyleElement
public abstract class StyleElement
extends ElementWithAttributes
implements Locator, Container, InstructionInfo
Field Summary | |
static int | |
static int | |
static int | |
static int | |
protected String | |
protected String | |
protected short[] | |
protected int | |
protected StaticContext | |
protected XPathException | |
protected BigDecimal |
Fields inherited from class net.sf.saxon.tree.ElementWithAttributes | |
attributeList , namespaceList |
Fields inherited from class net.sf.saxon.tree.ElementImpl | |
nameCode , root |
Fields inherited from class net.sf.saxon.tree.ParentNodeImpl | |
sequence |
Fields inherited from class net.sf.saxon.tree.NodeImpl | |
NODE_LETTER , index , parent |
Fields inherited from interface net.sf.saxon.om.NodeInfo | |
ALL_NAMESPACES , EMPTY_NAMESPACE_LIST , IS_DTD_TYPE , IS_NILLED , LOCAL_NAMESPACES , NO_NAMESPACES |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation | |
EMPTY_VALUE_ARRAY |
Constructor Summary | |
|
Method Summary | |
protected int |
|
void |
|
void |
|
boolean |
|
XSLVariableDeclaration |
|
void |
|
protected void |
|
void |
|
protected void |
|
void |
|
abstract Expression |
|
protected void |
|
protected void |
|
protected void |
|
Expression |
|
protected void |
|
protected boolean |
|
protected boolean |
|
protected Expression |
|
void |
|
boolean |
|
List |
|
protected AttributeSet[] |
|
String |
|
protected ItemType |
|
int |
|
SlotManager |
|
XSLStylesheet |
|
protected String |
|
protected String |
|
Executable | |
int |
|
protected StyleElement |
|
int |
|
int |
|
LocationProvider |
|
NamespaceResolver |
|
StructuredQName |
|
StructuredQName |
|
int |
|
PreparedStylesheet |
|
XSLStylesheet |
|
Iterator |
|
Object |
|
protected ItemType |
|
SchemaType |
|
StaticContext |
|
XSLFunction |
|
String |
|
int |
|
BigDecimal |
|
protected WithParam[] |
|
boolean |
|
protected boolean |
|
boolean |
|
boolean |
|
protected boolean |
|
boolean |
|
protected void |
|
protected void |
|
protected Expression |
|
Expression |
|
ExpressionVisitor |
|
SavedNamespaceContext |
|
Pattern |
|
StructuredQName |
|
SequenceType |
|
protected SortKeyDefinition[] |
|
protected static TraceWrapper |
|
protected void |
|
protected boolean |
|
protected boolean |
|
void |
|
protected abstract void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
boolean |
|
void |
|
void |
|
void |
|
protected void |
|
void |
|
Expression |
|
Pattern | |
protected void |
|
void |
|
protected void |
|
void |
|
Methods inherited from class net.sf.saxon.tree.ElementWithAttributes | |
copy , getAttributeList , getAttributeValue , getDeclaredNamespaces , getInScopeNamespaceCodes , getPrefixForURI , getURICodeForPrefix , getURIForPrefix , initialise , iteratePrefixes , setNamespaceDeclarations |
Methods inherited from class net.sf.saxon.tree.ElementImpl | |
copy , generateId , getAttributeList , getBaseURI , getDeclaredNamespaces , getDocumentRoot , getLineNumber , getNameCode , getNodeKind , getRoot , getSystemId , initialise , setLineNumber , setNameCode , setSystemId |
Methods inherited from class net.sf.saxon.tree.ParentNodeImpl | |
addChild , compact , enumerateChildren , getFirstChild , getLastChild , getNthChild , getSequenceNumber , getStringValue , getStringValueCS , hasChildNodes , useChildrenArray |
public static final int REPORT_ALWAYS
- Field Value:
- 1
public static final int REPORT_IF_INSTANTIATED
- Field Value:
- 3
public static final int REPORT_UNLESS_FALLBACK_AVAILABLE
- Field Value:
- 4
public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE
- Field Value:
- 2
protected String defaultCollationName
protected String defaultXPathNamespace
protected short[] extensionNamespaces
protected int reportingCircumstances
protected BigDecimal version
protected int allocateLocationId(String systemId, int lineNumber)
Allocate a location identifier
- Parameters:
systemId
- identifies the module containing the instructionlineNumber
- the line number of the instruction
- Returns:
- an integer location ID which can be used to report the location of the instruction, by reference to a
LocationProvider
public void allocatePatternSlots(Pattern match, SlotManager frame)
Allocate space for range variables within predicates in the match pattern. The xsl:template element has no XPath expressions among its attributes, so if this method is called on this object it can only be because there are variables used in the match pattern. We work out how many slots are needed for the match pattern in each template rule, and then apply-templates can allocate a stack frame that is large enough for the most demanding match pattern in the entire stylesheet.
- Parameters:
match
- the patternframe
- the stackframe outline for this pattern
public void allocateSlots(Expression exp)
Allocate slots in the local stack frame to range variables used in an XPath expression
- Parameters:
exp
- the XPath expression for which slots are to be allocated
public boolean backwardsCompatibleModeIsEnabled()
Determine whether backwards-compatible mode is enabled for this element
- Returns:
- true if backwards compatable mode is enabled, that is, if this or an enclosing element specifies [xsl:]version="1.0"
public XSLVariableDeclaration bindVariable(StructuredQName qName) throws XPathException
Bind a variable used in this element to the compiled form of the XSLVariable element in which it is declared
- Parameters:
qName
- The name of the variable
- Returns:
- the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable
- Throws:
XPathException
- if the variable has not been declared
public void checkEmpty() throws XPathException
Convenience method to check that the stylesheet element is empty
- Throws:
XPathException
- if it is not empty
protected void checkSortComesFirst(boolean sortRequired) throws XPathException
Check that among the children of this element, any xsl:sort elements precede any other elements
- Parameters:
sortRequired
- true if there must be at least one xsl:sort element
- Throws:
XPathException
- if invalid
public void checkTopLevel(String errorCode) throws XPathException
Convenience method to check that the stylesheet element is at the top level
- Parameters:
errorCode
- the error to throw if it is not at the top level; defaults to XTSE0010 if the value is null
- Throws:
XPathException
- if not at top level
protected void checkUnknownAttribute(int nc) throws XPathException
Check whether an unknown attribute is permitted.
- Parameters:
nc
- The name code of the attribute name
- Throws:
XPathException
- (and reports the error) if this is an attribute that is not permitted on the containing element
public void checkWithinTemplate() throws XPathException
Check that the stylesheet element is within a sequence constructor
- Throws:
XPathException
- if not within a sequence constructor
public abstract Expression compile(Executable exec) throws XPathException
Compile the instruction on the stylesheet tree into an executable instruction for use at run-time.
- Parameters:
exec
- the Executable
- Returns:
- either a ComputedExpression, or null. The value null is returned when compiling an instruction that returns a no-op, or when compiling a top-level object such as an xsl:template that compiles into something other than an instruction.
protected void compileError(String message) throws XPathException
Report a static error in the stylesheet
- Parameters:
message
- the error message
- Throws:
XPathException
- always, after reporting the error to the ErrorListener
protected void compileError(String message, String errorCode) throws XPathException
Compile time error, specifying an error code
- Parameters:
message
- the error messageerrorCode
- the error code. May be null if not known or not defined
- Throws:
XPathException
-
protected void compileError(XPathException error) throws XPathException
Report an error with diagnostic information
- Parameters:
error
- contains information about the error
- Throws:
XPathException
- always, after reporting the error to the ErrorListener
public Expression compileSequenceConstructor(Executable exec, AxisIterator iter, boolean includeParams) throws XPathException
Compile the children of this instruction on the stylesheet tree, adding the subordinate instructions to the parent instruction on the execution tree.
- Parameters:
exec
- the Executableiter
- Iterator over the children. This is used in the case where there are children that are not part of the sequence constructor, for example the xsl:sort children of xsl:for-each; the iterator can be positioned past such elements.includeParams
- true if xsl:param elements are to be treated as child instructions (true for templates but not for functions)
- Returns:
- an Expression tree representing the children of this instruction
protected boolean definesExcludedNamespace(short uriCode)
Check whether this node excludes a particular namespace from the result. This method checks this node only, not the ancestor nodes.
- Parameters:
uriCode
- the code of the namespace URI being tested
- Returns:
- true if the namespace is excluded by virtue of an [xsl:]exclude-result-prefixes attribute
protected boolean definesExtensionElement(short uriCode)
Check whether a particular extension element namespace is defined on this node. This checks this node only, not the ancestor nodes. The implementation checks whether the prefix is included in the [xsl:]extension-element-prefixes attribute.
- Parameters:
uriCode
- the namespace URI code being tested
- Returns:
- true if this namespace is defined on this element as an extension element namespace
protected Expression fallbackProcessing(Executable exec, StyleElement instruction) throws XPathException
Perform fallback processing. Generate fallback code for an extension instruction that is not recognized by the implementation.
- Parameters:
exec
- the Executableinstruction
- The unknown extension instruction
- Returns:
- the expression tree representing the fallback code
public void fixupReferences() throws XPathException
Fix up references from XPath expressions. Overridden for function declarations and variable declarations
public boolean forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled for this element
- Returns:
- true if forwards-compatible mode is enabled
public List getAllStylesheetFunctions()
Get a list of all stylesheet functions, excluding any that are masked by one of higher precedence
- Returns:
- a list of all stylesheet functions. The members of the list are instances of class XSLFunction
protected AttributeSet[] getAttributeSets(String use, List list) throws XPathException
Get the list of attribute-sets associated with this element. This is used for xsl:element, xsl:copy, xsl:attribute-set, and on literal result elements
- Parameters:
use
- the original value of the [xsl:]use-attribute-sets attributelist
- an empty list to hold the list of XSLAttributeSet elements in the stylesheet tree. Or null, if these are not required.
- Returns:
- an array of AttributeList instructions representing the compiled attribute sets
public String getAttributeValue(String clarkName)
Get an attribute value given the Clark name of the attribute (that is, the name in {uri}local format).
- Parameters:
clarkName
- the name of the attribute in {uri}local format
- Returns:
- the value of the attribute if it exists, or null otherwise
protected ItemType getCommonChildItemType()
Get the most general type of item returned by the children of this instruction
- Returns:
- the lowest common supertype of the item types returned by the children
public int getConstructType()
Get the type of construct. This will be a constant in classLocation
. This method is part of theInstructionInfo
interface
- Specified by:
- getConstructType in interface InstructionInfo
public SlotManager getContainingSlotManager()
Get the SlotManager for the containing Procedure definition
- Returns:
- the SlotManager associated with the containing Function, Template, etc, or null if there is no such containing Function, Template etc.
public XSLStylesheet getContainingStylesheet()
Get the containing XSLStylesheet element
- Returns:
- the XSLStylesheet element representing the outermost element of the containing stylesheet module
protected String getDefaultCollationName()
Get the default collation for this stylesheet element. If no default collation is specified in the stylesheet, return the Unicode codepoint collation name.
- Returns:
- the name of the default collation
protected String getDefaultXPathNamespace()
Get the default XPath namespace for elements and types
- Returns:
- the default namespace for elements and types. Return
NamespaceConstant.NULL
for the non-namespace
public int getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
- Specified by:
- getHostLanguage in interface Container
- Returns:
- typically
Configuration.XSLT
orConfiguration.XQUERY
protected StyleElement getLastChildInstruction()
Find the last child instruction of this instruction. Returns null if there are no child instructions, or if the last child is a text node.
- Returns:
- the last child instruction, or null if there are no child instructions
public int getLineNumber()
Get the line number of the instruction in the source stylesheet module. If this is not known, or if the instruction is an artificial one that does not relate to anything in the source code, the value returned may be -1.
- Specified by:
- getLineNumber in interface InstructionInfo
- getLineNumber in interface NodeInfo
- Overrides:
- getLineNumber in interface ElementImpl
public int getLineNumber(long locationId)
Get the line number within the document or module containing a particular location
- Specified by:
- getLineNumber in interface LocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
- Returns:
- the line number within the document or module.
public LocationProvider getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.
- Specified by:
- getLocationProvider in interface Container
public NamespaceResolver getNamespaceResolver()
Get the namespace context of the instruction.
- Specified by:
- getNamespaceResolver in interface InstructionInfo
- Returns:
- the namespace context. This method does not make a copy of the namespace context, so a reference to the returned NamespaceResolver will lock the stylesheet tree in memory.
public StructuredQName getObjectName()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be null.
- Returns:
- the name of the object declared in this element, if any
public StructuredQName getObjectName(NamePool pool)
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be -1.
- Specified by:
- getObjectName in interface InstructionInfo
- Parameters:
pool
- the name pool (not needed in this implementation of the method)
public int getPrecedence()
Get the import precedence of this stylesheet element.
- Returns:
- the import precedence. The actual numeric value is arbitrary, but a higher number indicates a higher precedence.
public PreparedStylesheet getPreparedStylesheet()
Get the PreparedStylesheet object.
- Returns:
- the PreparedStylesheet to which this stylesheet element belongs
public XSLStylesheet getPrincipalStylesheet()
Get the principal XSLStylesheet node. This gets the principal style sheet, i.e. the one originally loaded, that forms the root of the import/include tree
- Returns:
- the xsl:stylesheet element at the root of the principal stylesheet module
public Iterator getProperties()
Get an iterator over all the properties available. The values returned by the iterator will be of type String, and each string can be supplied as input to the getProperty() method to retrieve the value of the property.
- Specified by:
- getProperties in interface InstructionInfo
public Object getProperty(String name)
Get the value of a particular property of the instruction. This is part of theInstructionInfo
interface for run-time tracing and debugging. The properties available include all the attributes of the source instruction (named by the attribute name): these are all provided as string values.
- Specified by:
- getProperty in interface InstructionInfo
- Parameters:
name
- The name of the required property
- Returns:
- The value of the requested property, or null if the property is not available
protected ItemType getReturnedItemType()
Determine the type of item returned by this instruction (only relevant if it is an instruction). Default implementation returns Type.ITEM, indicating that we don't know, it might be anything. Returns null in the case of an element such as xsl:sort or xsl:variable that can appear in a sequence constructor but contributes nothing to the result sequence.
- Returns:
- the item type returned
public SchemaType getSchemaType(String typeAtt) throws XPathException
Get the Schema type definition for a type named in the stylesheet (in a "type" attribute).
- Parameters:
typeAtt
- the value of the type attribute
- Returns:
- the corresponding schema type
- Throws:
XPathException
- if the type is not declared in an imported schema, or is not a built-in type
public StaticContext getStaticContext()
Get the static context for expressions on this element
- Returns:
- the static context
public XSLFunction getStylesheetFunction(StructuredQName qName, int arity)
Get a FunctionCall declared using an xsl:function element in the stylesheet
- Parameters:
qName
- the name of the functionarity
- the number of arguments in the function call. The value -1 indicates that any arity will do (this is used to support the function-available() function).
- Returns:
- the XSLFunction object representing the function declaration in the stylesheet, or null if no such function is defined.
public String getSystemId(long locationId)
Get the URI of the document or module containing a particular location
- Specified by:
- getSystemId in interface LocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
- Returns:
- the URI of the document or module.
public int getTypeAnnotation(SchemaType schemaType)
Get the type annotation to use for a given schema type
- Parameters:
schemaType
- the schema type
- Returns:
- the corresponding numeric type annotation
public BigDecimal getVersion()
Get the numeric value of the version number on this element, or inherited from its ancestors
- Returns:
- the version number as a decimal
protected WithParam[] getWithParamInstructions(Executable exec, boolean tunnel, Instruction caller) throws XPathException
Get the list of xsl:with-param elements for a calling element (apply-templates, call-template, apply-imports, next-match). This method can be used to get either the tunnel parameters, or the non-tunnel parameters.
- Parameters:
exec
- the Executabletunnel
- true if the tunnel="yes" parameters are wanted, false to getcaller
- the calling instruction (for example xsl:apply-templates
- Returns:
- an array of WithParam objects for either the ordinary parameters or the tunnel parameters
public boolean isExcludedNamespace(short uriCode)
Check whether a namespace uri defines an namespace excluded from the result. This checks whether the namespace is defined as an excluded namespace on this or any ancestor node.
- Parameters:
uriCode
- the code of the namespace URI being tested
- Returns:
- true if this namespace URI is a namespace excluded by virtue of exclude-result-prefixes on this element or on an ancestor element
protected boolean isExplaining()
Determine whether saxon:explain has been set to "yes"
- Returns:
- true if saxon:explain has been set to "yes" on this element
public boolean isExtensionNamespace(short uriCode)
Check whether a namespace uri defines an extension element. This checks whether the namespace is defined as an extension namespace on this or any ancestor node.
- Parameters:
uriCode
- the namespace URI code being tested
- Returns:
- true if the URI is an extension element namespace URI
public boolean isInstruction()
Determine whether this node is an instruction. The default implementation says it isn't.
- Returns:
- true if this element is an instruction
protected boolean isPermittedChild(StyleElement child)
Check whether a given child is permitted for this element. This method is used when a non-instruction child element such as xsl:sort is encountered in a context where instructions would normally be expected.
- Parameters:
child
- the child that may or may not be permitted
- Returns:
- true if the child is permitted.
public boolean isTopLevel()
Test whether this is a top-level element
- Returns:
- true if the element is a child of the xsl:stylesheet element
protected void issueWarning(String message, SourceLocator locator)
Report a warning to the error listener
- Parameters:
message
- the warning message textlocator
- the location of the problem in the source stylesheet
protected void issueWarning(TransformerException error)
Report a warning to the error listener
- Parameters:
error
- an exception containing the warning text
protected Expression makeAttributeValueTemplate(String expression) throws XPathException
Make an attribute value template in the context of this stylesheet element
- Parameters:
expression
- the source text of the attribute value template
- Returns:
- a compiled XPath expression that computes the value of the attribute (including concatenating the results of embedded expressions with any surrounding fixed text)
public Expression makeExpression(String expression) throws XPathException
Compile an XPath expression in the context of this stylesheet element
- Parameters:
expression
- the source text of the XPath expression
- Returns:
- the compiled expression tree for the XPath expression
public ExpressionVisitor makeExpressionVisitor()
Make an expression visitor
- Returns:
- the expression visitor
public SavedNamespaceContext makeNamespaceContext()
Make a NamespaceContext object representing the list of in-scope namespaces. This will be a copy of the namespace context with no references to objects in the stylesheet tree, so that it can be kept until run-time without locking the tree down in memory.
- Returns:
- a copy of the namespace context
public Pattern makePattern(String pattern) throws XPathException
Make a pattern in the context of this stylesheet element
- Parameters:
pattern
- the source text of the pattern
- Returns:
- the compiled pattern
public final StructuredQName makeQName(String lexicalQName) throws XPathException, NamespaceException
Make a structured QName, using this Element as the context for namespace resolution, and registering the code in the namepool. If the name is unprefixed, the default namespace is not used.
- Parameters:
lexicalQName
- The lexical QName as written, in the form "[prefix:]localname". The name must have already been validated as a syntactically-correct QName. Leading and trailing whitespace will be trimmed
- Returns:
- the StructuredQName representation of this lexical QName
- Throws:
XPathException
- if the qname is not a lexically-valid QName, or if the name is in a reserved namespace.NamespaceException
- if the prefix of the qname has not been declared
public SequenceType makeSequenceType(String sequenceType) throws XPathException
Process an attribute whose value is a SequenceType
- Parameters:
sequenceType
- the source text of the attribute
- Returns:
- the processed sequence type
- Throws:
XPathException
- if the syntax is invalid or for example if it refers to a type that is not in the static context
protected SortKeyDefinition[] makeSortKeys() throws XPathException
Construct sort keys for a SortedIterator
- Returns:
- an array of SortKeyDefinition objects if there are any sort keys; or null if there are none.
protected static TraceWrapper makeTraceInstruction(StyleElement source, Expression child)
Create a trace instruction to wrap a real instruction
- Parameters:
source
- the parent elementchild
- the compiled expression tree for the instruction to be traced
- Returns:
- a wrapper instruction that performs the tracing (if activated at run-time)
protected void markTailCalls()
Mark tail-recursive calls on templates and functions. For most instructions, this does nothing.
protected boolean mayContainFallback()
Determine whether this type of element is allowed to contain an xsl:fallback instruction
- Returns:
- true if this element is allowed to contain an xsl:fallback
protected boolean mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor
- Returns:
- true if this instruction is allowed to contain a sequence constructor
public void postValidate() throws XPathException
Hook to allow additional validation of a parent element immediately after its children have been validated.
protected abstract void prepareAttributes() throws XPathException
Set the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass
protected void processAllAttributes() throws XPathException
Process the attributes of this element and all its children
- Throws:
XPathException
- in the event of a static error being detected
protected final void processAttributes() throws XPathException
Process the attribute list for the element. This is a wrapper method that calls prepareAttributes (provided in the subclass) and traps any exceptions
protected void processDefaultCollationAttribute(String nc) throws XPathException
Process the [xsl:]default-xpath-namespace attribute if there is one
- Parameters:
nc
- the Clark name of the attribute required
protected void processDefaultXPathNamespaceAttribute(String nc)
Process the [xsl:]default-xpath-namespace attribute if there is one
- Parameters:
nc
- the Clark name of the attribute required
protected void processExcludedNamespaces(String nc) throws XPathException
Process the [xsl:]exclude-result-prefixes attribute if there is one
- Parameters:
nc
- the Clark name of the attribute required
protected void processExtensionElementAttribute(String nc) throws XPathException
Process the [xsl:]extension-element-prefixes attribute if there is one
- Parameters:
nc
- the Clark name of the attribute required
protected void processVersionAttribute(String nc) throws XPathException
Process the [xsl:]version attribute if there is one
- Parameters:
nc
- the Clark name of the attribute required
public boolean replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression
- Specified by:
- replaceSubExpression in interface Container
- Parameters:
original
- the original subexpressionreplacement
- the replacement subexpression
- Returns:
- true if the original subexpression is found
public void reportAbsence(String attribute) throws XPathException
Convenience method to report the absence of a mandatory attribute
- Parameters:
attribute
- the name of the attribute whose absence is to be reported
- Throws:
XPathException
- if the attribute is missing
public void setLineNumber(int lineNumber)
Set the line number of the element within its source document entity
- Overrides:
- setLineNumber in interface ElementImpl
- Parameters:
public void setObjectName(StructuredQName qName)
Set the object name, for example the name of a function, variable, or template declared on this element
- Parameters:
qName
- the object name as a QName
protected void setValidationError(TransformerException reason, int circumstances)
Set a validation error. This is an error detected during construction of this element on the stylesheet, but which is not to be reported until later.
- Parameters:
reason
- the details of the errorcircumstances
- a code identifying the circumstances under which the error is to be reported
public void substituteFor(StyleElement temp)
Make this node a substitute for a temporary one previously added to the tree. See StyleNodeFactory for details. "A node like the other one in all things but its class". Note that at this stage, the node will not yet be known to its parent, though it will contain a reference to its parent; and it will have no children.
- Parameters:
temp
- the element which this one is substituting for
public Expression typeCheck(String name, Expression exp) throws XPathException
Type-check an expression. This is called to check each expression while the containing instruction is being validated. It is not just a static type-check, it also adds code to perform any necessary run-time type checking and/or conversion.
- Parameters:
name
- the name of the attribute containing the expression to be checked (used for diagnostics)exp
- the expression to be checked
- Returns:
- the (possibly rewritten) expression after type checking
public Pattern typeCheck(String name, Pattern pattern) throws XPathException
Type-check a pattern. This is called to check each pattern while the containing instruction is being validated. It is not just a static type-check, it also adds code to perform any necessary run-time type checking and/or conversion.
- Parameters:
name
- the name of the attribute holding the pattern, for example "match": used in diagnosticspattern
- the compiled pattern
- Returns:
- the original pattern, or a substitute pattern if it has been rewritten
protected void undeclaredNamespaceError(String prefix, String errorCode) throws XPathException
public void validate() throws XPathException
Check that the stylesheet element is valid. This is called once for each element, after the entire tree has been built. As well as validation, it can perform first-time initialisation. The default implementation does nothing; it is normally overriden in subclasses.
protected void validateChildren() throws XPathException
Validate the children of this node, recursively. Overridden for top-level data elements.
public void validateSubtree() throws XPathException
Recursive walk through the stylesheet to validate all nodes