public class ExpressionContext extends 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.
|
String |
getDefaultCollationName()
Get the default collation.
|
String |
getDefaultElementNamespace()
Get the default XPath namespace for elements and types
Return NamespaceConstant.NULL for the non-namespace
|
String |
getDefaultFunctionNamespace()
Get the default function namespace
|
FunctionLibrary |
getFunctionLibrary()
Get the function library containing all the in-scope functions available in this static
context
|
Set<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
|
StylesheetPackage |
getPackageData()
Get information about the containing package (unit of compilation)
|
ItemType |
getRequiredContextItemType()
Get the required type of the context item.
|
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
|
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.
|
boolean |
isElementAvailable(String qname)
Determine if an extension element is available
|
boolean |
isImportedSchema(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(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
|
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()
StaticContext
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(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 String getSystemId()
getSystemId
in interface StaticContext
public 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 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(String qname) throws XPathException
isElementAvailable
in interface XSLTStaticContext
XPathException
- if the name is invalid or the prefix is not declaredpublic String getDefaultCollationName()
getDefaultCollationName
in interface StaticContext
public String getDefaultElementNamespace()
getDefaultElementNamespace
in interface StaticContext
public String getDefaultFunctionNamespace()
getDefaultFunctionNamespace
in interface StaticContext
public boolean isInBackwardsCompatibleMode()
isInBackwardsCompatibleMode
in interface StaticContext
public int getXPathVersion()
getXPathVersion
in interface StaticContext
public boolean isImportedSchema(String namespace)
isImportedSchema
in interface StaticContext
namespace
- the target namespace of the required schemapublic Set<String> getImportedSchemaNamespaces()
getImportedSchemaNamespaces
in interface StaticContext
public KeyManager getKeyManager()
getKeyManager
in interface StaticContext
public StyleElement getStyleElement()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.