Package com.icl.saxon.expr
Class StandaloneContext
- java.lang.Object
-
- com.icl.saxon.expr.StandaloneContext
-
- All 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.
-
-
Constructor Summary
Constructors Constructor Description StandaloneContext()Create a StandaloneContext using the default NamePoolStandaloneContext(NamePool pool)Create a StandaloneContext using a specific NamePool
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsKeyFunction()Determine whether the key() function is permmitted in this contextBindingbindVariable(int fingerprint)Bind a variable used in this element to the XSLVariable element in which it is declaredvoiddeclareNamespace(java.lang.String prefix, java.lang.String uri)Declare a namespace whose prefix can be used in expressionsbooleanforwardsCompatibleModeIsEnabled()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)Make a fingerprint, using this Element as the context for namespace resolutionintgetLineNumber()Get the line number of the expression within that containerFunctiongetStyleSheetFunction(int fingerprint)java.lang.StringgetSystemId()Get the system ID of the container of the expressionjava.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 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.
-
-
-
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
-
declareNamespace
public void declareNamespace(java.lang.String prefix, java.lang.String uri)Declare a namespace whose prefix can be used in expressions
-
makeRuntimeContext
public StaticContext makeRuntimeContext(NamePool pool)
Copy the context with a different namepool. Not implemented, returns null.- Specified by:
makeRuntimeContextin interfaceStaticContext
-
getSystemId
public java.lang.String getSystemId()
Get the system ID of the container of the expression- Specified by:
getSystemIdin interfaceStaticContext- Returns:
- "" always
-
getBaseURI
public 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.- Specified by:
getBaseURIin interfaceStaticContext- Returns:
- "" always
-
getLineNumber
public int getLineNumber()
Get the line number of the expression within that container- Specified by:
getLineNumberin interfaceStaticContext- Returns:
- -1 always
-
getURIForPrefix
public java.lang.String getURIForPrefix(java.lang.String prefix) throws XPathExceptionGet 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
public final int makeNameCode(java.lang.String qname, boolean useDefault) throws XPathExceptionMake 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
public final int getFingerprint(java.lang.String qname, boolean useDefault) throws XPathExceptionMake a fingerprint, using this Element 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, java.lang.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
public NamespaceTest makeNamespaceTest(short nodeType, java.lang.String prefix) throws XPathException
Make a NamespaceTest, using this element as the context for namespace resolution- Specified by:
makeNamespaceTestin interfaceStaticContext- Throws:
XPathException
-
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:
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, 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:
isExtensionNamespacein interfaceStaticContext
-
forwardsCompatibleModeIsEnabled
public boolean forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled- Specified by:
forwardsCompatibleModeIsEnabledin interfaceStaticContext
-
getStyleSheetFunction
public Function getStyleSheetFunction(int fingerprint) throws XPathException
- Specified by:
getStyleSheetFunctionin interfaceStaticContext- Throws:
XPathException
-
getExternalJavaClass
public java.lang.Class getExternalJavaClass(java.lang.String uri)
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. This implementation always returns null.
-
isElementAvailable
public boolean isElementAvailable(java.lang.String qname) throws XPathExceptionDetermine if an extension element is available- Specified by:
isElementAvailablein interfaceStaticContext- Throws:
XPathException
-
isFunctionAvailable
public boolean isFunctionAvailable(java.lang.String qname) throws XPathExceptionDetermine 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
public java.lang.String getVersion()
Get the effective XSLT version in this region of the stylesheet- Specified by:
getVersionin interfaceStaticContext
-
-