Package com.icl.saxon.expr
Class StandaloneContext
java.lang.Object
com.icl.saxon.expr.StandaloneContext
- All Implemented Interfaces:
StaticContext
A StandaloneContext provides a context for parsing an expression or pattern appearing
in a context other than a stylesheet.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a StandaloneContext using the default NamePoolStandaloneContext
(NamePool pool) Create a StandaloneContext using a specific NamePool -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether the key() function is permmitted in this contextbindVariable
(int fingerprint) Bind a variable used in this element to the XSLVariable element in which it is declaredvoid
declareNamespace
(String prefix, String uri) Declare a namespace whose prefix can be used in expressionsboolean
Determine whether forwards-compatible mode is enabledGet the Base URI of the stylesheet element, for resolving any relative URI's used in the expression.Get an external Java class corresponding to a given namespace prefix, if there is one.final int
getFingerprint
(String qname, boolean useDefault) Make a fingerprint, using this Element as the context for namespace resolutionint
Get the line number of the expression within that containergetStyleSheetFunction
(int fingerprint) Get the system ID of the container of the expressiongetURIForPrefix
(String prefix) Get the URI for a prefix, using this Element as the context for namespace resolutionGet the effective XSLT version in this region of the stylesheetboolean
isElementAvailable
(String qname) Determine if an extension element is availableboolean
isExtensionNamespace
(short uriCode) Determine whether a given URI identifies an extension element namespaceboolean
isFunctionAvailable
(String qname) Determine if a function is availablefinal int
makeNameCode
(String qname, boolean useDefault) Make a NameCode, using this Element as the context for namespace resolutionmakeNamespaceTest
(short nodeType, String prefix) Make a NamespaceTest, using this element as the context for namespace resolutionmakeNameTest
(short nodeType, String qname, boolean useDefault) Make a NameTest, using this element as the context for namespace resolutionmakeRuntimeContext
(NamePool pool) Copy the context with a different namepool.
-
Constructor Details
-
StandaloneContext
public StandaloneContext()Create a StandaloneContext using the default NamePool -
StandaloneContext
Create a StandaloneContext using a specific NamePool
-
-
Method Details
-
declareNamespace
Declare a namespace whose prefix can be used in expressions -
makeRuntimeContext
Copy the context with a different namepool. Not implemented, returns null.- Specified by:
makeRuntimeContext
in interfaceStaticContext
-
getSystemId
Get the system ID of the container of the expression- Specified by:
getSystemId
in interfaceStaticContext
- Returns:
- "" always
-
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 interfaceStaticContext
- Returns:
- "" always
-
getLineNumber
public int getLineNumber()Get the line number of the expression within that container- Specified by:
getLineNumber
in interfaceStaticContext
- Returns:
- -1 always
-
getURIForPrefix
Get the URI for a prefix, using this Element as the context for namespace resolution- Specified by:
getURIForPrefix
in interfaceStaticContext
- Parameters:
prefix
- The prefix- Throws:
XPathException
-
makeNameCode
Make a NameCode, using this Element as the context for namespace resolution- Specified by:
makeNameCode
in interfaceStaticContext
- Parameters:
qname
- The name as written, in the form "[prefix:]localname"- Throws:
XPathException
-
getFingerprint
Make a fingerprint, using this Element as the context for namespace resolution- Specified by:
getFingerprint
in interfaceStaticContext
- Parameters:
qname
- The name as written, in the form "[prefix:]localname"- Returns:
- -1 if the name is not already present in the name pool
- Throws:
XPathException
-
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 interfaceStaticContext
- Throws:
XPathException
-
makeNamespaceTest
Make a NamespaceTest, using this element as the context for namespace resolution- Specified by:
makeNamespaceTest
in interfaceStaticContext
- Throws:
XPathException
-
bindVariable
Bind a variable used in this element to the XSLVariable element in which it is declared- Specified by:
bindVariable
in interfaceStaticContext
- Parameters:
fingerprint
- The fingerprint of the variable name- Returns:
- a Binding object that can be used to identify it in the Bindery
- Throws:
XPathException
- if the variable has not been declared, or if the context does not allow the use of variables
-
isExtensionNamespace
public boolean isExtensionNamespace(short uriCode) Determine whether a given URI identifies an extension element namespace- Specified by:
isExtensionNamespace
in interfaceStaticContext
-
forwardsCompatibleModeIsEnabled
public boolean forwardsCompatibleModeIsEnabled()Determine whether forwards-compatible mode is enabled- Specified by:
forwardsCompatibleModeIsEnabled
in interfaceStaticContext
-
getStyleSheetFunction
- Specified by:
getStyleSheetFunction
in interfaceStaticContext
- Throws:
XPathException
-
getExternalJavaClass
Get an external Java class corresponding to a given namespace prefix, if there is one.- Specified by:
getExternalJavaClass
in interfaceStaticContext
- 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.
-
isElementAvailable
Determine if an extension element is available- Specified by:
isElementAvailable
in interfaceStaticContext
- Throws:
XPathException
-
isFunctionAvailable
Determine if a function is available- Specified by:
isFunctionAvailable
in interfaceStaticContext
- Throws:
XPathException
-
allowsKeyFunction
public boolean allowsKeyFunction()Determine whether the key() function is permmitted in this context- Specified by:
allowsKeyFunction
in interfaceStaticContext
-
getVersion
Get the effective XSLT version in this region of the stylesheet- Specified by:
getVersion
in interfaceStaticContext
-