Package net.sf.saxon.trans
Class KeyDefinition
java.lang.Object
net.sf.saxon.instruct.Procedure
net.sf.saxon.trans.KeyDefinition
- All Implemented Interfaces:
Serializable
,SourceLocator
,LocationProvider
,Container
,InstructionInfoProvider
Corresponds to a single xsl:key declaration.
- Author:
- Michael H. Kay
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionKeyDefinition
(Pattern match, Expression use, String collationName, Comparator collation) Constructor to create a key definition -
Method Summary
Modifier and TypeMethodDescriptionGet the collation.Get the collation name for this key definition.Get the InstructionInfo details about the construct.getMatch()
Get the match pattern for the key definitiongetUse()
Get the use expression for the key definitionboolean
Test backwards compatibility modeboolean
Get whether strict comparison is needed.void
setBackwardsCompatible
(boolean bc) Set backwards compatibility mode.void
setLocation
(String systemId, int lineNumber) Set the system Id and line number of the source xsl:key definitionvoid
Set the map of local variables needed while evaluating the "use" expressionvoid
setStrictComparison
(boolean strict) Set whether strict comparison is needed.Methods inherited from class net.sf.saxon.instruct.Procedure
getBody, getColumnNumber, getExecutable, getHostLanguage, getLineNumber, getLineNumber, getLocationProvider, getPublicId, getStackFrameMap, getSystemId, getSystemId, replaceSubExpression, setBody, setExecutable, setHostLanguage, setLineNumber, setSystemId
-
Constructor Details
-
KeyDefinition
Constructor to create a key definition- Parameters:
match
- the pattern in the xsl:key match attributeuse
- the expression in the xsl:key use attribute, or the expression that results from compiling the xsl:key contained instructionscollationName
- the name of the collation being usedcollation
- the actual collation. This must be one that supports generation of collation keys.
-
-
Method Details
-
setBackwardsCompatible
public void setBackwardsCompatible(boolean bc) Set backwards compatibility mode. The key definition is backwards compatible if ANY of the xsl:key declarations has version="1.0" in scope. -
isBackwardsCompatible
public boolean isBackwardsCompatible()Test backwards compatibility mode -
setStrictComparison
public void setStrictComparison(boolean strict) Set whether strict comparison is needed. Strict comparison treats non-comparable values as an error rather than a no-match. This is used for internal keys that support value comparisons in Saxon-SA, it is not used for user-defined XSLT keys. -
isStrictComparison
public boolean isStrictComparison()Get whether strict comparison is needed. -
setStackFrameMap
Set the map of local variables needed while evaluating the "use" expression- Overrides:
setStackFrameMap
in classProcedure
-
setLocation
Set the system Id and line number of the source xsl:key definition -
getMatch
Get the match pattern for the key definition- Returns:
- the pattern specified in the "match" attribute of the xsl:key declaration
-
getUse
Get the use expression for the key definition- Returns:
- the expression specified in the "use" attribute of the xsl:key declaration
-
getCollationName
Get the collation name for this key definition.- Returns:
- the collation name (the collation URI)
-
getCollation
Get the collation.- Returns:
- the collation
-
getInstructionInfo
Get the InstructionInfo details about the construct. This information isn't used for tracing, but it is available when inspecting the context stack.- Specified by:
getInstructionInfo
in interfaceInstructionInfoProvider
-