com.icl.saxon.expr

Class StandaloneContext

public class StandaloneContext extends Object implements StaticContext

A StandaloneContext provides a context for parsing an expression or pattern appearing in a context other than a stylesheet.
Constructor Summary
StandaloneContext()
Create a StandaloneContext using the default NamePool
StandaloneContext(NamePool pool)
Create a StandaloneContext using a specific NamePool
Method Summary
booleanallowsKeyFunction()
Determine whether the key() function is permmitted in this context
BindingbindVariable(int fingerprint)
Bind a variable used in this element to the XSLVariable element in which it is declared
voiddeclareNamespace(String prefix, String uri)
Declare a namespace whose prefix can be used in expressions
booleanforwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled
StringgetBaseURI()
Get the Base URI of the stylesheet element, for resolving any relative URI's used in the expression.
ClassgetExternalJavaClass(String uri)
Get an external Java class corresponding to a given namespace prefix, if there is one.
intgetFingerprint(String qname, boolean useDefault)
Make a fingerprint, using this Element as the context for namespace resolution
intgetLineNumber()
Get the line number of the expression within that container
FunctiongetStyleSheetFunction(int fingerprint)
StringgetSystemId()
Get the system ID of the container of the expression
StringgetURIForPrefix(String prefix)
Get the URI for a prefix, using this Element as the context for namespace resolution
StringgetVersion()
Get the effective XSLT version in this region of the stylesheet
booleanisElementAvailable(String qname)
Determine if an extension element is available
booleanisExtensionNamespace(short uriCode)
Determine whether a given URI identifies an extension element namespace
booleanisFunctionAvailable(String qname)
Determine if a function is available
intmakeNameCode(String qname, boolean useDefault)
Make a NameCode, using this Element as the context for namespace resolution
NamespaceTestmakeNamespaceTest(short nodeType, String prefix)
Make a NamespaceTest, using this element as the context for namespace resolution
NameTestmakeNameTest(short nodeType, String qname, boolean useDefault)
Make a NameTest, using this element as the context for namespace resolution
StaticContextmakeRuntimeContext(NamePool pool)
Copy the context with a different namepool.

Constructor Detail

StandaloneContext

public StandaloneContext()
Create a StandaloneContext using the default NamePool

StandaloneContext

public StandaloneContext(NamePool pool)
Create a StandaloneContext using a specific NamePool

Method Detail

allowsKeyFunction

public boolean allowsKeyFunction()
Determine whether the key() function is permmitted in this context

bindVariable

public Binding bindVariable(int fingerprint)
Bind a variable used in this element to the XSLVariable element in which it is declared

declareNamespace

public void declareNamespace(String prefix, String uri)
Declare a namespace whose prefix can be used in expressions

forwardsCompatibleModeIsEnabled

public boolean forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled

getBaseURI

public String getBaseURI()
Get the Base URI of the stylesheet element, for resolving any relative URI's used in the expression. Used by the document() function.

Returns: "" always

getExternalJavaClass

public Class getExternalJavaClass(String uri)
Get an external Java class corresponding to a given namespace prefix, if there is one.

Parameters: uri The namespace URI corresponding to the prefix used in the function call.

Returns: the Java class name if a suitable class exists, otherwise return null. This implementation always returns null.

getFingerprint

public final int getFingerprint(String qname, boolean useDefault)
Make a fingerprint, using this Element as the context for namespace resolution

Parameters: qname The name as written, in the form "[prefix:]localname"

UNKNOWN: useDefault Defines the action when there is no prefix. If true, use the default namespace URI (as for element names). If false, use no namespace URI (as for attribute names). XPathException if the name is not already present in the namepool.

getLineNumber

public int getLineNumber()
Get the line number of the expression within that container

Returns: -1 always

getStyleSheetFunction

public Function getStyleSheetFunction(int fingerprint)

getSystemId

public String getSystemId()
Get the system ID of the container of the expression

Returns: "" always

getURIForPrefix

public String getURIForPrefix(String prefix)
Get the URI for a prefix, using this Element as the context for namespace resolution

Parameters: prefix The prefix

UNKNOWN: XPathException if the prefix is not declared

getVersion

public String getVersion()
Get the effective XSLT version in this region of the stylesheet

isElementAvailable

public boolean isElementAvailable(String qname)
Determine if an extension element is available

isExtensionNamespace

public boolean isExtensionNamespace(short uriCode)
Determine whether a given URI identifies an extension element namespace

isFunctionAvailable

public boolean isFunctionAvailable(String qname)
Determine if a function is available

makeNameCode

public final int makeNameCode(String qname, boolean useDefault)
Make a NameCode, using this Element as the context for namespace resolution

Parameters: qname The name as written, in the form "[prefix:]localname"

UNKNOWN: useDefault Defines the action when there is no prefix. If true, use the default namespace URI (as for element names). If false, use no namespace URI (as for attribute names).

makeNamespaceTest

public NamespaceTest makeNamespaceTest(short nodeType, String prefix)
Make a NamespaceTest, using this element as the context for namespace resolution

makeNameTest

public NameTest makeNameTest(short nodeType, String qname, boolean useDefault)
Make a NameTest, using this element as the context for namespace resolution

makeRuntimeContext

public StaticContext makeRuntimeContext(NamePool pool)
Copy the context with a different namepool. Not implemented, returns null.