A StaticContext contains the information needed while an expression or pattern
is being parsed. The information is also sometimes needed at run-time.
allowsKeyFunction
public boolean allowsKeyFunction()
Determine whether the key() function is permmitted in this context
bindVariable
public Binding bindVariable(int fingerprint)
throws XPathException
Bind a variable to an object that can be used to refer to it
fingerprint
- The fingerprint of the variable name
- a Binding object that can be used to identify it in the Bindery
XPathException
- if the variable has not been declared, or if the context
does not allow the use of variables
forwardsCompatibleModeIsEnabled
public boolean forwardsCompatibleModeIsEnabled()
throws XPathException
Determine whether forwards-compatible mode is enabled
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.
getExternalJavaClass
public Class getExternalJavaClass(String uri)
throws TransformerException
Get an external Java class corresponding to a given namespace prefix, if there is
one.
uri
- The namespace URI corresponding to the prefix used in the function call.
- the Java class if a suitable class exists, otherwise return null.
getFingerprint
public int getFingerprint(String qname,
boolean useDefault)
throws XPathException
Get a fingerprint for a name, using this as the context for namespace resolution
qname
- The name as written, in the form "[prefix:]localname"
- -1 if the name is not already present in the name pool
getLineNumber
public int getLineNumber()
Get the line number of the expression within its containing entity
Returns -1 if no line number is available
getSystemId
public 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.
getURIForPrefix
public String getURIForPrefix(String prefix)
throws XPathException
Get the URI for a prefix, using this Element as the context for namespace resolution
prefix
- The prefix
getVersion
public String getVersion()
Get the effective XSLT version in this region of the stylesheet
isElementAvailable
public boolean isElementAvailable(String qname)
throws XPathException
Determine if an extension element is available
isExtensionNamespace
public boolean isExtensionNamespace(short uriCode)
throws XPathException
Determine whether a given URI code identifies an extension element namespace
isFunctionAvailable
public boolean isFunctionAvailable(String qname)
throws XPathException
Determine if a function is available
makeNameCode
public int makeNameCode(String qname,
boolean useDefault)
throws XPathException
Make a NameCode, using this Element as the context for namespace resolution
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
makeNamespaceTest
public NamespaceTest makeNamespaceTest(short nodeType,
String prefix)
throws XPathException
Make a NamespaceTest, using this element as the context for namespace resolution
makeRuntimeContext
public StaticContext makeRuntimeContext(NamePool pool)
Copy the context with a different namepool