com.icl.saxon.expr

Class StandaloneContext

Implemented Interfaces:
StaticContext

public class StandaloneContext
extends java.lang.Object
implements StaticContext

A StandaloneContext provides a context for parsing an expression or pattern appearing in a context other than a stylesheet.

Nested Class Summary

Constructor Summary

StandaloneContext()
Create a StandaloneContext using the default NamePool
StandaloneContext(NamePool pool)
Create a StandaloneContext using a specific NamePool

Method Summary

boolean
allowsKeyFunction()
Determine whether the key() function is permmitted in this context
Binding
bindVariable(int fingerprint)
Bind a variable used in this element to the XSLVariable element in which it is declared
void
declareNamespace(String prefix, String uri)
Declare a namespace whose prefix can be used in expressions
boolean
forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled
String
getBaseURI()
Get the Base URI of the stylesheet element, for resolving any relative URI's used in the expression.
Class
getExternalJavaClass(String uri)
Get an external Java class corresponding to a given namespace prefix, if there is one.
int
getFingerprint(String qname, boolean useDefault)
Make a fingerprint, using this Element as the context for namespace resolution
int
getLineNumber()
Get the line number of the expression within that container
Function
getStyleSheetFunction(int fingerprint)
String
getSystemId()
Get the system ID of the container of the expression
String
getURIForPrefix(String prefix)
Get the URI for a prefix, using this Element as the context for namespace resolution
String
getVersion()
Get the effective XSLT version in this region of the stylesheet
boolean
isElementAvailable(String qname)
Determine if an extension element is available
boolean
isExtensionNamespace(short uriCode)
Determine whether a given URI identifies an extension element namespace
boolean
isFunctionAvailable(String qname)
Determine if a function is available
int
makeNameCode(String qname, boolean useDefault)
Make a NameCode, using this Element as the context for namespace resolution
NameTest
makeNameTest(short nodeType, String qname, boolean useDefault)
Make a NameTest, using this element as the context for namespace resolution
NamespaceTest
makeNamespaceTest(short nodeType, String prefix)
Make a NamespaceTest, using this element as the context for namespace resolution
StaticContext
makeRuntimeContext(NamePool pool)
Copy the context with a different namepool.

Constructor Details

StandaloneContext

public StandaloneContext()
Create a StandaloneContext using the default NamePool


StandaloneContext

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

Method Details

allowsKeyFunction

public boolean allowsKeyFunction()
Determine whether the key() function is permmitted in this context
Specified by:
allowsKeyFunction in interface StaticContext


bindVariable

public Binding bindVariable(int fingerprint)
            throws XPathException
Bind a variable used in this element to the XSLVariable element in which it is declared
Specified by:
bindVariable in interface StaticContext


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
Specified by:
forwardsCompatibleModeIsEnabled in interface StaticContext


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.
Specified by:
getBaseURI in interface StaticContext

Returns:
"" always


getExternalJavaClass

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

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)
            throws XPathException
Make a fingerprint, using this Element as the context for namespace resolution
Specified by:
getFingerprint in interface StaticContext

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


getLineNumber

public int getLineNumber()
Get the line number of the expression within that container
Specified by:
getLineNumber in interface StaticContext

Returns:
-1 always


getStyleSheetFunction

public Function getStyleSheetFunction(int fingerprint)
            throws XPathException
Specified by:
getStyleSheetFunction in interface StaticContext


getSystemId

public String getSystemId()
Get the system ID of the container of the expression
Specified by:
getSystemId in interface StaticContext

Returns:
"" always


getURIForPrefix

public String getURIForPrefix(String prefix)
            throws XPathException
Get the URI for a prefix, using this Element as the context for namespace resolution
Specified by:
getURIForPrefix in interface StaticContext

Parameters:
prefix - The prefix


getVersion

public String getVersion()
Get the effective XSLT version in this region of the stylesheet
Specified by:
getVersion in interface StaticContext


isElementAvailable

public boolean isElementAvailable(String qname)
            throws XPathException
Determine if an extension element is available
Specified by:
isElementAvailable in interface StaticContext


isExtensionNamespace

public boolean isExtensionNamespace(short uriCode)
Determine whether a given URI identifies an extension element namespace
Specified by:
isExtensionNamespace in interface StaticContext


isFunctionAvailable

public boolean isFunctionAvailable(String qname)
            throws XPathException
Determine if a function is available
Specified by:
isFunctionAvailable in interface StaticContext


makeNameCode

public final int makeNameCode(String qname,
                              boolean useDefault)
            throws XPathException
Make a NameCode, using this Element as the context for namespace resolution
Specified by:
makeNameCode in interface StaticContext

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


makeNameTest

public NameTest makeNameTest(short nodeType,
                             String qname,
                             boolean useDefault)
            throws XPathException
Make a NameTest, using this element as the context for namespace resolution
Specified by:
makeNameTest in interface StaticContext


makeNamespaceTest

public NamespaceTest makeNamespaceTest(short nodeType,
                                       String prefix)
            throws XPathException
Make a NamespaceTest, using this element as the context for namespace resolution
Specified by:
makeNamespaceTest in interface StaticContext


makeRuntimeContext

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