Package com.icl.saxon.expr
Interface StaticContext
-
- All Known Implementing Classes:
ExpressionContext,StandaloneContext
public interface StaticContextA StaticContext contains the information needed while an expression or pattern is being parsed. The information is also sometimes needed at run-time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanallowsKeyFunction()Determine whether the key() function is permmitted in this contextBindingbindVariable(int fingerprint)Bind a variable to an object that can be used to refer to itbooleanforwardsCompatibleModeIsEnabled()Determine whether forwards-compatible mode is enabledjava.lang.StringgetBaseURI()Get the Base URI of the stylesheet element, for resolving any relative URI's used in the expression.java.lang.ClassgetExternalJavaClass(java.lang.String uri)Get an external Java class corresponding to a given namespace prefix, if there is one.intgetFingerprint(java.lang.String qname, boolean useDefault)Get a fingerprint for a name, using this as the context for namespace resolutionintgetLineNumber()Get the line number of the expression within its containing entity Returns -1 if no line number is availableFunctiongetStyleSheetFunction(int fingerprint)java.lang.StringgetSystemId()Get the System ID of the container of the expression.java.lang.StringgetURIForPrefix(java.lang.String prefix)Get the URI for a prefix, using this Element as the context for namespace resolutionjava.lang.StringgetVersion()Get the effective XSLT version in this region of the stylesheetbooleanisElementAvailable(java.lang.String qname)Determine if an extension element is availablebooleanisExtensionNamespace(short uriCode)Determine whether a given URI code identifies an extension element namespacebooleanisFunctionAvailable(java.lang.String qname)Determine if a function is availableintmakeNameCode(java.lang.String qname, boolean useDefault)Make a NameCode, using this Element as the context for namespace resolutionNamespaceTestmakeNamespaceTest(short nodeType, java.lang.String prefix)Make a NamespaceTest, using this element as the context for namespace resolutionNameTestmakeNameTest(short nodeType, java.lang.String qname, boolean useDefault)Make a NameTest, using this element as the context for namespace resolutionStaticContextmakeRuntimeContext(NamePool pool)Copy the context with a different namepool
-
-
-
Method Detail
-
makeRuntimeContext
StaticContext makeRuntimeContext(NamePool pool)
Copy the context with a different namepool
-
getSystemId
java.lang.String getSystemId()
Get the System ID of the container of the expression. This is the containing entity (file) and is therefore useful for diagnostics. Use getBaseURI() to get the base URI, which may be different.
-
getLineNumber
int getLineNumber()
Get the line number of the expression within its containing entity Returns -1 if no line number is available
-
getBaseURI
java.lang.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.
-
getURIForPrefix
java.lang.String getURIForPrefix(java.lang.String prefix) throws XPathExceptionGet the URI for a prefix, using this Element as the context for namespace resolution- Parameters:
prefix- The prefix- Throws:
XPathException
-
makeNameCode
int makeNameCode(java.lang.String qname, boolean useDefault) throws XPathExceptionMake a NameCode, using this Element as the context for namespace resolution- Parameters:
qname- The name as written, in the form "[prefix:]localname"- Throws:
XPathException
-
getFingerprint
int getFingerprint(java.lang.String qname, boolean useDefault) throws XPathExceptionGet a fingerprint for a name, using this as the context for namespace resolution- 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
NameTest makeNameTest(short nodeType, java.lang.String qname, boolean useDefault) throws XPathException
Make a NameTest, using this element as the context for namespace resolution- Throws:
XPathException
-
makeNamespaceTest
NamespaceTest makeNamespaceTest(short nodeType, java.lang.String prefix) throws XPathException
Make a NamespaceTest, using this element as the context for namespace resolution- Throws:
XPathException
-
bindVariable
Binding bindVariable(int fingerprint) throws XPathException
Bind a variable to an object that can be used to refer to it- 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
boolean isExtensionNamespace(short uriCode) throws XPathExceptionDetermine whether a given URI code identifies an extension element namespace- Throws:
XPathException
-
forwardsCompatibleModeIsEnabled
boolean forwardsCompatibleModeIsEnabled() throws XPathExceptionDetermine whether forwards-compatible mode is enabled- Throws:
XPathException
-
getStyleSheetFunction
Function getStyleSheetFunction(int fingerprint) throws XPathException
- Throws:
XPathException
-
getExternalJavaClass
java.lang.Class getExternalJavaClass(java.lang.String uri) throws javax.xml.transform.TransformerExceptionGet 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 if a suitable class exists, otherwise return null.
- Throws:
javax.xml.transform.TransformerException- if the class is found, but cannot be loaded.
-
isElementAvailable
boolean isElementAvailable(java.lang.String qname) throws XPathExceptionDetermine if an extension element is available- Throws:
XPathException
-
isFunctionAvailable
boolean isFunctionAvailable(java.lang.String qname) throws XPathExceptionDetermine if a function is available- Throws:
XPathException
-
allowsKeyFunction
boolean allowsKeyFunction()
Determine whether the key() function is permmitted in this context
-
getVersion
java.lang.String getVersion()
Get the effective XSLT version in this region of the stylesheet
-
-