net.sf.saxon.style
public abstract class StyleElement extends ElementWithAttributes implements Locator, Container, InstructionInfo
Field Summary | |
---|---|
protected String | defaultCollationName |
protected String | defaultXPathNamespace |
protected short[] | extensionNamespaces |
protected int | reportingCircumstances |
static int | REPORT_ALWAYS |
static int | REPORT_IF_INSTANTIATED |
static int | REPORT_UNLESS_FALLBACK_AVAILABLE |
static int | REPORT_UNLESS_FORWARDS_COMPATIBLE |
protected StaticContext | staticContext |
protected StaticError | validationError |
protected BigDecimal | version |
Constructor Summary | |
---|---|
StyleElement()
Constructor |
Method Summary | |
---|---|
int | allocateLocationId(String systemId, int lineNumber)
Allocate a location identifier |
void | allocateSlots(Expression exp)
Allocate slots in the local stack frame to range variables used in an XPath expression
|
boolean | backwardsCompatibleModeIsEnabled()
Determine whether backwards-compatible mode is enabled for this element |
XSLVariableDeclaration | bindVariable(int fingerprint)
Bind a variable used in this element to the compiled form of the XSLVariable element in which it is
declared
|
void | checkEmpty()
Convenience method to check that the stylesheet element is empty
|
protected void | checkSortComesFirst(boolean sortRequired)
Check that among the children of this element, any xsl:sort elements precede any other elements
|
void | checkTopLevel(String errorCode)
Convenience method to check that the stylesheet element is at the top level
|
protected void | checkUnknownAttribute(int nc)
Check whether an unknown attribute is permitted.
|
void | checkWithinTemplate()
Check that the stylesheet element is within a sequence constructor
|
abstract Expression | compile(Executable exec)
Compile the instruction on the stylesheet tree into an executable instruction
for use at run-time.
|
protected void | compileError(TransformerException error)
Construct an exception with diagnostic information |
protected void | compileError(String message) |
protected void | compileError(String message, String errorCode)
Compile time error, specifying an error code
|
Expression | compileSequenceConstructor(Executable exec, AxisIterator iter, boolean includeParams)
Compile the children of this instruction on the stylesheet tree, adding the
subordinate instructions to the parent instruction on the execution tree.
|
protected void | compileWarning(String message, String errorCode) |
protected boolean | definesExcludedNamespace(short uriCode)
Check whether this node excludes a particular namespace from the result.
|
protected boolean | definesExtensionElement(short uriCode)
Check whether a particular extension element namespace is defined on this node.
|
protected Expression | fallbackProcessing(Executable exec, StyleElement instruction)
Perform fallback processing. |
void | fixupReferences()
Fix up references from XPath expressions. |
boolean | forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled for this element |
protected AttributeSet[] | getAttributeSets(String use, List list)
Get the list of attribute-sets associated with this element.
|
String | getAttributeValue(String clarkName)
Get an attribute value given the Clark name of the attribute (that is,
the name in {uri}local format). |
protected ItemType | getCommonChildItemType()
Get the most general type of item returned by the children of this instruction
|
int | getConstructType()
Get the type of construct. |
SlotManager | getContainingSlotManager()
Get the SlotManager for the containing Procedure definition
|
XSLStylesheet | getContainingStylesheet()
Get the containing XSLStylesheet element |
protected String | getDefaultCollationName()
Get the default collation for this element |
protected short | getDefaultXPathNamespace()
Get the default XPath namespace code applicable to this element |
Executable | getExecutable() |
int | getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
protected StyleElement | getLastChildInstruction()
Find the last child instruction of this instruction. |
int | getLineNumber() |
int | getLineNumber(int locationId) |
LocationProvider | getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamespaceResolver | getNamespaceResolver()
Get the namespace context of the instruction. |
int | getObjectFingerprint()
Get a fingerprint identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc. |
int | getObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc. |
int | getPrecedence()
Get the import precedence of this stylesheet element. |
PreparedStylesheet | getPreparedStylesheet()
Get the PreparedStylesheet object.
|
protected XSLStylesheet | getPrincipalStylesheet()
Get the principal XSLStylesheet node. |
Iterator | getProperties()
Get an iterator over all the properties available. |
Object | getProperty(String name)
Get the value of a particular property of the instruction. |
protected ItemType | getReturnedItemType()
Determine the type of item returned by this instruction (only relevant if
it is an instruction). |
SchemaType | getSchemaType(String typeAtt)
Get the Schema type definition for a type named in the stylesheet (in a
"type" attribute).
|
StaticContext | getStaticContext()
Get the static context for expressions on this element
|
XSLFunction | getStylesheetFunction(int fingerprint, int arity)
Get a FunctionCall declared using an xsl:function element in the stylesheet
|
String | getSystemId(int locationId) |
NamePool | getTargetNamePool()
Get the namepool to be used at run-time, this namepool holds the names used in
all XPath expressions and patterns |
int | getTypeAnnotation(SchemaType schemaType)
Get the type annotation to use for a given schema type |
BigDecimal | getVersion()
Get the numeric value of the version number on this element,
or inherited from its ancestors |
protected WithParam[] | getWithParamInstructions(Executable exec, boolean tunnel, Instruction caller)
Get the list of xsl:with-param elements for a calling element (apply-templates,
call-template, apply-imports, next-match). |
boolean | isExcludedNamespace(short uriCode)
Check whether a namespace uri defines an namespace excluded from the result.
|
protected boolean | isExplaining()
Determine whether saxon:explain has been set to "yes" |
boolean | isExtensionNamespace(short uriCode)
Check whether a namespace uri defines an extension element. |
boolean | isInstruction()
Determine whether this node is an instruction. |
protected boolean | isPermittedChild(StyleElement child)
Specify that certain children are permitted for this element |
protected void | issueWarning(TransformerException error)
Construct an exception with diagnostic information |
protected void | issueWarning(String message, SourceLocator locator) |
boolean | isTopLevel()
Test whether this is a top-level element |
Expression | makeAttributeValueTemplate(String expression)
Make an attribute value template in the context of this stylesheet element |
Expression | makeExpression(String expression)
Make an expression in the context of this stylesheet element |
int | makeNameCode(String qname)
Make a NameCode, using this Element as the context for namespace resolution, and
registering the code in the namepool. |
SavedNamespaceContext | makeNamespaceContext()
Make a NamespaceContext object representing the list of in-scope namespaces. |
Pattern | makePattern(String pattern)
Make a pattern in the context of this stylesheet element |
SequenceType | makeSequenceType(String sequenceType)
Process an attribute whose value is a SequenceType |
protected SortKeyDefinition[] | makeSortKeys()
Construct sort keys for a SortedIterator
|
protected static TraceWrapper | makeTraceInstruction(StyleElement source, Expression child)
Create a trace instruction to wrap a real instruction |
void | markTailCalls()
Mark tail-recursive calls on templates and functions.
|
boolean | mayContainFallback()
Determine whether this type of element is allowed to contain an xsl:fallback
instruction |
boolean | mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor |
void | postValidate()
Hook to allow additional validation of a parent element immediately after its
children have been validated. |
abstract void | prepareAttributes()
Set the attribute list for the element. |
void | processAllAttributes()
Process the attributes of this element and all its children |
void | processAttributes()
Process the attribute list for the element. |
protected void | processDefaultCollationAttribute(String nc)
Process the [xsl:]default-xpath-namespace attribute if there is one
|
protected void | processDefaultXPathNamespaceAttribute(String nc)
Process the [xsl:]default-xpath-namespace attribute if there is one
|
protected void | processExcludedNamespaces(String nc)
Process the [xsl:]exclude-result-prefixes attribute if there is one
|
protected void | processExtensionElementAttribute(String nc)
Process the [xsl:]extension-element-prefixes attribute if there is one
|
protected void | processVersionAttribute(String nc)
Process the [xsl:]version attribute if there is one
|
void | reportAbsence(String attribute)
Convenience method to report the absence of a mandatory attribute
|
void | setLineNumber(int lineNumber) |
void | setObjectNameCode(int nameCode)
Set the object name code |
protected void | setValidationError(TransformerException reason, int circumstances)
Set a validation error |
void | substituteFor(StyleElement temp)
Make this node a substitute for a temporary one previously added to the tree. |
Expression | typeCheck(String name, Expression exp)
Type-check an expression. |
Pattern | typeCheck(String name, Pattern pattern)
Type-check a pattern. |
protected void | undeclaredNamespaceError(String prefix, String errorCode) |
void | validate()
Check that the stylesheet element is valid. |
protected void | validateChildren()
Validate the children of this node, recursively. |
void | validateSubtree()
Recursive walk through the stylesheet to validate all nodes |
Parameters: exp the XPath expression for which slots are to be allocated
Parameters: fingerprint The fingerprint of the name of the variable
Returns: the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable
Throws: net.sf.saxon.trans.StaticError if the variable has not been declared
Throws: XPathException if it is not empty
Parameters: sortRequired true if there must be at least one xsl:sort element
Throws: XPathException if invalid
Throws: XPathException if not at top level
Parameters: nc The name code of the attribute name
Throws: XPathException if not within a sequence constructor
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.
Parameters: message the error message errorCode the error code. May be null if not known or not defined
Throws: XPathException
Returns: the array of children
Parameters: uriCode the code of the namespace URI being tested
Parameters: uriCode the namespace URI code being tested
Parameters: instruction The unknown extension instruction
Parameters: use the original value of the [xsl:]use-attribute-sets attribute list 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
Returns: the lowest common supertype of the item types returned by the children
Returns: the SlotManager associated with the containing Function, Template, etc, or null if there is no such containing Function, Template etc.
Returns: the PreparedStylesheet to which this stylesheet element belongs
Parameters: name The name of the required property
Returns: The value of the requested property, or null if the property is not available
Returns: the item type returned
Throws: XPathException if the type is not declared in an imported schema, or is not a built-in type
Returns: the static context
Parameters: fingerprint the fingerprint of the name of the function arity 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.
Parameters: tunnel true if the tunnel="yes" parameters are wanted, false to get caller
Parameters: uriCode the code of the namespace URI being tested
Parameters: uriCode the namespace URI code being tested
Parameters: qname The name as written, in the form "[prefix:]localname". The name must have already been validated as a syntactically-correct 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
Returns: an array of SortKeyDefinition objects if there are any sort keys; or null if there are none.
Parameters: nc the Clark name of the attribute required
Parameters: nc the Clark name of the attribute required
Parameters: nc the Clark name of the attribute required
Parameters: nc the Clark name of the attribute required
Parameters: nc the Clark name of the attribute required
Throws: XPathException if the attribute is missing