net.sf.saxon.trans

Class KeyDefinition

public class KeyDefinition extends Procedure implements Serializable, InstructionInfoProvider

Corresponds to a single xsl:key declaration.

Author: Michael H. Kay

Constructor Summary
KeyDefinition(Pattern match, Expression use, String collationName, Comparator collation)
Constructor to create a key definition
Method Summary
ComparatorgetCollation()
Get the collation.
StringgetCollationName()
Get the collation name for this key definition.
InstructionInfogetInstructionInfo()
Get the InstructionInfo details about the construct.
PatterngetMatch()
Get the match pattern for the key definition
ExpressiongetUse()
Get the use expression for the key definition
booleanisBackwardsCompatible()
Test backwards compatibility mode
voidsetBackwardsCompatible(boolean bc)
Set backwards compatibility mode.
voidsetLocation(String systemId, int lineNumber)
Set the system Id and line number of the source xsl:key definition
voidsetStackFrameMap(SlotManager map)
Set the map of local variables needed while evaluating the "use" expression

Constructor Detail

KeyDefinition

public KeyDefinition(Pattern match, Expression use, String collationName, Comparator collation)
Constructor to create a key definition

Parameters: match the pattern in the xsl:key match attribute use the expression in the xsl:key use attribute, or the expression that results from compiling the xsl:key contained instructions collationName the name of the collation being used collation the actual collation. This must be one that supports generation of collation keys.

Method Detail

getCollation

public Comparator getCollation()
Get the collation.

Returns: the collation

getCollationName

public String getCollationName()
Get the collation name for this key definition.

Returns: the collation name (the collation URI)

getInstructionInfo

public InstructionInfo getInstructionInfo()
Get the InstructionInfo details about the construct. This information isn't used for tracing, but it is available when inspecting the context stack.

getMatch

public Pattern getMatch()
Get the match pattern for the key definition

Returns: the pattern specified in the "match" attribute of the xsl:key declaration

getUse

public Expression getUse()
Get the use expression for the key definition

Returns: the expression specified in the "use" attribute of the xsl:key declaration

isBackwardsCompatible

public boolean isBackwardsCompatible()
Test backwards compatibility mode

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.

setLocation

public void setLocation(String systemId, int lineNumber)
Set the system Id and line number of the source xsl:key definition

setStackFrameMap

public void setStackFrameMap(SlotManager map)
Set the map of local variables needed while evaluating the "use" expression