public class ExpressionContext extends Object implements StaticContext
Constructor and Description |
---|
ExpressionContext(StyleElement styleElement) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsKeyFunction()
Determine whether the key() function is permmitted in this context
|
Binding |
bindVariable(int fingerprint)
Bind a variable to an object that can be used to refer to it
|
boolean |
forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled
|
String |
getBaseURI()
Get the Base URI of the element containing the expression, for resolving any
relative URI's used in the expression.
|
Class |
getExternalJavaClass(String uri)
Get an external Java class corresponding to a given namespace prefix, if there is
one.
|
int |
getFingerprint(String qname,
boolean useDefault)
Get a fingerprint for a name, using this as the context for namespace resolution
|
int |
getLineNumber()
Get the line number of the expression within its containing entity
Returns -1 if no line number is available
|
Function |
getStyleSheetFunction(int fingerprint) |
String |
getSystemId()
Get the System ID of the entity containing the expression (used for diagnostics)
|
String |
getURIForPrefix(String prefix)
Get the URI for a prefix, using this Element as the context for namespace resolution
|
String |
getVersion()
Get the effective XSLT version in this region of the stylesheet
|
boolean |
isElementAvailable(String qname)
Determine if an extension element is available
|
boolean |
isExtensionNamespace(short uriCode)
Determine whether a given URI code identifies an extension element namespace
|
boolean |
isFunctionAvailable(String qname)
Determine if a function is available
|
int |
makeNameCode(String qname,
boolean useDefault)
Make a NameCode, using this Element as the context for namespace resolution
|
NamespaceTest |
makeNamespaceTest(short nodeType,
String prefix)
Make a NamespaceTest, using this element as the context for namespace resolution
|
NameTest |
makeNameTest(short nodeType,
String qname,
boolean useDefault)
Make a NameTest, using this element as the context for namespace resolution
|
StaticContext |
makeRuntimeContext(NamePool pool)
Create a context for parsing XPath expressions at runtime, using this styelsheet
element for namespace declarations, variables, etc, but using the runtime NamePool
|
String |
toString()
String representation for diagnostics
|
public ExpressionContext(StyleElement styleElement)
public StaticContext makeRuntimeContext(NamePool pool)
makeRuntimeContext
in interface StaticContext
public String getSystemId()
getSystemId
in interface StaticContext
public int getLineNumber()
getLineNumber
in interface StaticContext
public String getBaseURI()
getBaseURI
in interface StaticContext
public String getURIForPrefix(String prefix) throws XPathException
getURIForPrefix
in interface StaticContext
prefix
- The prefixXPathException
public final int makeNameCode(String qname, boolean useDefault) throws XPathException
makeNameCode
in interface StaticContext
qname
- The name as written, in the form "[prefix:]localname"XPathException
public int getFingerprint(String qname, boolean useDefault) throws XPathException
getFingerprint
in interface StaticContext
qname
- The name as written, in the form "[prefix:]localname"XPathException
public NameTest makeNameTest(short nodeType, String qname, boolean useDefault) throws XPathException
makeNameTest
in interface StaticContext
XPathException
public NamespaceTest makeNamespaceTest(short nodeType, String prefix) throws XPathException
makeNamespaceTest
in interface StaticContext
XPathException
public Binding bindVariable(int fingerprint) throws XPathException
bindVariable
in interface StaticContext
fingerprint
- The fingerprint of the variable nameXPathException
- if the variable has not been declaredpublic boolean isExtensionNamespace(short uriCode) throws XPathException
isExtensionNamespace
in interface StaticContext
XPathException
public boolean forwardsCompatibleModeIsEnabled() throws XPathException
forwardsCompatibleModeIsEnabled
in interface StaticContext
XPathException
public Function getStyleSheetFunction(int fingerprint) throws XPathException
getStyleSheetFunction
in interface StaticContext
XPathException
public Class getExternalJavaClass(String uri) throws TransformerException
getExternalJavaClass
in interface StaticContext
uri
- The namespace URI corresponding to the prefix used in the function call.TransformerException
- if the class is found, but cannot be loaded.public boolean isElementAvailable(String qname) throws XPathException
isElementAvailable
in interface StaticContext
XPathException
- if the name is invalid or the prefix is not declaredpublic boolean isFunctionAvailable(String qname) throws XPathException
isFunctionAvailable
in interface StaticContext
XPathException
public boolean allowsKeyFunction()
allowsKeyFunction
in interface StaticContext
public String getVersion()
getVersion
in interface StaticContext