public class ExpressionContext extends java.lang.Object implements XSLTStaticContext
Constructor and Description |
---|
ExpressionContext(StyleElement styleElement,
StructuredQName attributeName)
Create a static context for XPath expressions in an XSLT stylesheet
|
Modifier and Type | Method and Description |
---|---|
Expression |
bindVariable(StructuredQName qName)
Bind a variable to an object that can be used to refer to it
|
Configuration |
getConfiguration()
Get the system configuration
|
Location |
getContainingLocation()
Get the containing location of an XPath expression within the stylesheet
|
DecimalFormatManager |
getDecimalFormatManager()
Get a DecimalFormatManager to resolve the names of decimal formats used in calls
to the format-number() function.
|
java.lang.String |
getDefaultCollationName()
Get the default collation.
|
java.lang.String |
getDefaultElementNamespace()
Get the default XPath namespace for elements and types
Return NamespaceConstant.NULL for the non-namespace
|
java.lang.String |
getDefaultFunctionNamespace()
Get the default function namespace
|
FunctionLibrary |
getFunctionLibrary()
Get the function library containing all the in-scope functions available in this static
context
|
java.util.Set<java.lang.String> |
getImportedSchemaNamespaces()
Get the set of imported schemas
|
KeyManager |
getKeyManager()
Get the KeyManager, containing definitions of keys available for use.
|
NamespaceResolver |
getNamespaceResolver()
Get a copy of the NamespaceResolver suitable for saving in the executable code
|
OptimizerOptions |
getOptimizerOptions()
Get the optimization options in use.
|
StylesheetPackage |
getPackageData()
Get the containing XSLT package
|
ItemType |
getRequiredContextItemType()
Get the required type of the context item.
|
java.lang.String |
getStaticBaseURI()
Get the Base URI of the element containing the expression, for resolving any
relative URI's used in the expression.
|
StyleElement |
getStyleElement()
Get the stylesheet element containing this XPath expression
|
java.lang.String |
getSystemId()
Get the System ID of the entity containing the expression (used for diagnostics)
|
int |
getXPathVersion()
Get the XPath language level supported, as an integer (being the actual version
number times ten).
|
boolean |
isElementAvailable(java.lang.String qname)
Determine if an extension element is available
|
boolean |
isImportedSchema(java.lang.String namespace)
Test whether a schema has been imported for a given namespace
|
boolean |
isInBackwardsCompatibleMode()
Determine whether Backwards Compatible Mode is used
|
boolean |
isSchemaAware()
Ask whether expressions compiled under this static context are schema-aware.
|
void |
issueWarning(java.lang.String s,
Location locator)
Issue a compile-time warning
|
XPathContext |
makeEarlyEvaluationContext()
Construct a dynamic context for early evaluation of constant subexpressions
|
RetainedStaticContext |
makeRetainedStaticContext()
Construct a RetainedStaticContext, which extracts information from this StaticContext
to provide the subset of static context information that is potentially needed
during expression evaluation
|
ItemType |
resolveTypeAlias(StructuredQName typeName)
Get type alias.
|
public ExpressionContext(StyleElement styleElement, StructuredQName attributeName)
styleElement
- the element on which the XPath expression appearsattributeName
- the name of the attribute in which the XPath expression appears; or null
if the expression appears in a text nodepublic Configuration getConfiguration()
getConfiguration
in interface StaticContext
public StylesheetPackage getPackageData()
getPackageData
in interface StaticContext
public boolean isSchemaAware()
public XPathContext makeEarlyEvaluationContext()
makeEarlyEvaluationContext
in interface StaticContext
public RetainedStaticContext makeRetainedStaticContext()
makeRetainedStaticContext
in interface StaticContext
public Location getContainingLocation()
getContainingLocation
in interface StaticContext
public void issueWarning(java.lang.String s, Location locator)
issueWarning
in interface StaticContext
s
- The warning message. This should not contain any prefix such as "Warning".locator
- the location of the construct in question. May be null.public java.lang.String getSystemId()
getSystemId
in interface StaticContext
public java.lang.String getStaticBaseURI()
getStaticBaseURI
in interface StaticContext
public NamespaceResolver getNamespaceResolver()
getNamespaceResolver
in interface StaticContext
public ItemType getRequiredContextItemType()
getRequiredContextItemType
in interface StaticContext
public DecimalFormatManager getDecimalFormatManager()
getDecimalFormatManager
in interface StaticContext
public OptimizerOptions getOptimizerOptions()
Configuration
getOptimizerOptions
in interface StaticContext
public Expression bindVariable(StructuredQName qName) throws XPathException
bindVariable
in interface StaticContext
qName
- the name of the variableXPathException
- if the variable has not been declaredpublic FunctionLibrary getFunctionLibrary()
getFunctionLibrary
in interface StaticContext
public boolean isElementAvailable(java.lang.String qname) throws XPathException
isElementAvailable
in interface XSLTStaticContext
XPathException
- if the name is invalid or the prefix is not declaredpublic java.lang.String getDefaultCollationName()
getDefaultCollationName
in interface StaticContext
public java.lang.String getDefaultElementNamespace()
getDefaultElementNamespace
in interface StaticContext
public java.lang.String getDefaultFunctionNamespace()
getDefaultFunctionNamespace
in interface StaticContext
public boolean isInBackwardsCompatibleMode()
isInBackwardsCompatibleMode
in interface StaticContext
public int getXPathVersion()
getXPathVersion
in interface StaticContext
public boolean isImportedSchema(java.lang.String namespace)
isImportedSchema
in interface StaticContext
namespace
- the target namespace of the required schemapublic java.util.Set<java.lang.String> getImportedSchemaNamespaces()
getImportedSchemaNamespaces
in interface StaticContext
public KeyManager getKeyManager()
getKeyManager
in interface StaticContext
public StyleElement getStyleElement()
public ItemType resolveTypeAlias(StructuredQName typeName)
resolveTypeAlias
in interface StaticContext
typeName
- the name of the type aliasCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.