Class ExpressionContext
java.lang.Object
com.icl.saxon.style.ExpressionContext
- All Implemented Interfaces:
StaticContext
An ExpressionContext represents the context for an XPath expression written
in the stylesheet.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether the key() function is permmitted in this contextbindVariable(int fingerprint) Bind a variable to an object that can be used to refer to itbooleanDetermine whether forwards-compatible mode is enabledGet the Base URI of the element containing the expression, 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.intgetFingerprint(String qname, boolean useDefault) Get a fingerprint for a name, using this as the context for namespace resolutionintGet the line number of the expression within its containing entity Returns -1 if no line number is availablegetStyleSheetFunction(int fingerprint) Get the System ID of the entity containing the expression (used for diagnostics)getURIForPrefix(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 stylesheetbooleanisElementAvailable(String qname) Determine if an extension element is availablebooleanisExtensionNamespace(short uriCode) Determine whether a given URI code identifies an extension element namespacebooleanisFunctionAvailable(String qname) Determine if a function is availablefinal intmakeNameCode(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) Create a context for parsing XPath expressions at runtime, using this styelsheet element for namespace declarations, variables, etc, but using the runtime NamePooltoString()String representation for diagnostics
-
Constructor Details
-
ExpressionContext
-
-
Method Details
-
makeRuntimeContext
Create a context for parsing XPath expressions at runtime, using this styelsheet element for namespace declarations, variables, etc, but using the runtime NamePool- Specified by:
makeRuntimeContextin interfaceStaticContext
-
getSystemId
Get the System ID of the entity containing the expression (used for diagnostics)- Specified by:
getSystemIdin interfaceStaticContext
-
getLineNumber
public int getLineNumber()Get the line number of the expression within its containing entity Returns -1 if no line number is available- Specified by:
getLineNumberin interfaceStaticContext
-
getBaseURI
Get the Base URI of the element containing the expression, for resolving any relative URI's used in the expression. Used by the document() function.- Specified by:
getBaseURIin interfaceStaticContext
-
getURIForPrefix
Get the URI for a prefix, using this Element as the context for namespace resolution- Specified by:
getURIForPrefixin interfaceStaticContext- Parameters:
prefix- The prefix- Throws:
XPathException
-
makeNameCode
Make a NameCode, using this Element as the context for namespace resolution- Specified by:
makeNameCodein interfaceStaticContext- Parameters:
qname- The name as written, in the form "[prefix:]localname"- Throws:
XPathException
-
getFingerprint
Get a fingerprint for a name, using this as the context for namespace resolution- Specified by:
getFingerprintin 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:
makeNameTestin interfaceStaticContext- Throws:
XPathException
-
makeNamespaceTest
Make a NamespaceTest, using this element as the context for namespace resolution- Specified by:
makeNamespaceTestin interfaceStaticContext- Throws:
XPathException
-
bindVariable
Bind a variable to an object that can be used to refer to it- Specified by:
bindVariablein 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
-
isExtensionNamespace
Determine whether a given URI code identifies an extension element namespace- Specified by:
isExtensionNamespacein interfaceStaticContext- Throws:
XPathException
-
forwardsCompatibleModeIsEnabled
Determine whether forwards-compatible mode is enabled- Specified by:
forwardsCompatibleModeIsEnabledin interfaceStaticContext- Throws:
XPathException
-
getStyleSheetFunction
- Specified by:
getStyleSheetFunctionin interfaceStaticContext- Throws:
XPathException
-
getExternalJavaClass
Get an external Java class corresponding to a given namespace prefix, if there is one.- Specified by:
getExternalJavaClassin 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.
- Throws:
TransformerException- if the class is found, but cannot be loaded.
-
isElementAvailable
Determine if an extension element is available- Specified by:
isElementAvailablein interfaceStaticContext- Throws:
XPathException- if the name is invalid or the prefix is not declared
-
isFunctionAvailable
Determine if a function is available- Specified by:
isFunctionAvailablein interfaceStaticContext- Throws:
XPathException
-
allowsKeyFunction
public boolean allowsKeyFunction()Determine whether the key() function is permmitted in this context- Specified by:
allowsKeyFunctionin interfaceStaticContext
-
getVersion
Get the effective XSLT version in this region of the stylesheet- Specified by:
getVersionin interfaceStaticContext
-
toString
-