public class UseWhenStaticContext extends AbstractStaticContext implements XSLTStaticContext, Container
usingDefaultFunctionLibrary
Constructor and Description |
---|
UseWhenStaticContext(Configuration config,
NamespaceResolver namespaceContext,
Map<StructuredQName,GroundedValue> staticVariables)
Create a static context for evaluating use-when expressions
|
Modifier and Type | Method and Description |
---|---|
Expression |
bindVariable(StructuredQName qName)
Bind a variable used in this element to its declaration
|
int |
getContainerGranularity()
Get the granularity of the container.
|
DecimalFormatManager |
getDecimalFormatManager()
Get a DecimalFormatManager to resolve the names of decimal formats used in calls
to the format-number() function.
|
String |
getDefaultCollationName()
Get the name of the default collation.
|
String |
getDefaultFunctionNamespace()
Get the default function namespace
|
Executable |
getExecutable()
Get the Executable representing the containing XSLT stylesheet
|
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
|
NamespaceResolver |
getNamespaceResolver()
Get a namespace resolver to resolve the namespaces declared in this static context.
|
String |
getSystemId()
Get the System ID of the container of the expression.
|
String |
getURIForPrefix(String prefix)
Get the URI for a namespace prefix.
|
boolean |
isAllowedBuiltInType(BuiltInAtomicType type)
Determine whether a built-in type is available in this context.
|
boolean |
isElementAvailable(String qname)
Determine if an extension element is available
|
boolean |
isImportedSchema(String namespace)
Determine whether a Schema for a given target namespace has been imported.
|
boolean |
isInBackwardsCompatibleMode()
Determine whether Backwards Compatible Mode is used
|
void |
issueWarning(String s,
SourceLocator locator)
Issue a compile-time warning
|
addFunctionLibrary, declareCollation, getBaseURI, getCollation, getCollationMap, getColumnNumber, getConfiguration, getDefaultElementNamespace, getHostLanguage, getLineNumber, getLocationMap, getLocationProvider, getNamePool, getPublicId, getRequiredContextItemType, getXPathLanguageLevel, isSchemaAware, makeEarlyEvaluationContext, setBackwardsCompatibilityMode, setBaseURI, setCollationMap, setConfiguration, setDecimalFormatManager, setDefaultElementNamespace, setDefaultFunctionLibrary, setDefaultFunctionNamespace, setFunctionLibrary, setLocationMap, setSchemaAware, setXPathLanguageLevel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBaseURI, getCollation, getConfiguration, getDefaultElementNamespace, getLineNumber, getLocationMap, getNamePool, getRequiredContextItemType, getXPathLanguageLevel, isSchemaAware, makeEarlyEvaluationContext
getHostLanguage, getLocationProvider
getColumnNumber, getLineNumber, getPublicId
public UseWhenStaticContext(Configuration config, NamespaceResolver namespaceContext, Map<StructuredQName,GroundedValue> staticVariables)
config
- the Saxon configurationnamespaceContext
- the namespace context in which the use-when expression appearsstaticVariables
- the static variables available for use within use-when expressionspublic Executable getExecutable()
getExecutable
in interface Container
public void issueWarning(String s, SourceLocator locator)
issueWarning
in interface StaticContext
issueWarning
in class AbstractStaticContext
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 SourceLocator
getSystemId
in interface StaticContext
getSystemId
in class AbstractStaticContext
public int getContainerGranularity()
getContainerGranularity
in interface Container
public String getURIForPrefix(String prefix) throws XPathException
getURIForPrefix
in interface StaticContext
prefix
- The prefixXPathException
- if the prefix is not declaredpublic Expression bindVariable(StructuredQName qName) throws XPathException
bindVariable
in interface StaticContext
qName
- the name of the variableVariableReference
, suitably initialized to refer to the corresponding variable declaration,
but in general it can be any expression which returns the variable's value when evaluated. In this version of the method,
the value of the variable is known statically, so the returned expression is a literal containing the variable's value.XPathException
public FunctionLibrary getFunctionLibrary()
getFunctionLibrary
in interface StaticContext
getFunctionLibrary
in class AbstractStaticContext
public String getDefaultCollationName()
getDefaultCollationName
in interface StaticContext
getDefaultCollationName
in class AbstractStaticContext
public String getDefaultFunctionNamespace()
getDefaultFunctionNamespace
in interface StaticContext
getDefaultFunctionNamespace
in class AbstractStaticContext
public boolean isInBackwardsCompatibleMode()
isInBackwardsCompatibleMode
in interface StaticContext
isInBackwardsCompatibleMode
in class AbstractStaticContext
public boolean isImportedSchema(String namespace)
isImportedSchema
in interface StaticContext
namespace
- the target namespace in questionpublic Set<String> getImportedSchemaNamespaces()
getImportedSchemaNamespaces
in interface StaticContext
public boolean isAllowedBuiltInType(BuiltInAtomicType type)
isAllowedBuiltInType
in interface StaticContext
isAllowedBuiltInType
in class AbstractStaticContext
type
- the supposedly built-in type. This will always be a type in the
XS or XDT namespace.public NamespaceResolver getNamespaceResolver()
getNamespaceResolver
in interface StaticContext
public DecimalFormatManager getDecimalFormatManager()
getDecimalFormatManager
in interface StaticContext
getDecimalFormatManager
in class AbstractStaticContext
public boolean isElementAvailable(String qname) throws XPathException
isElementAvailable
in interface XSLTStaticContext
XPathException
- if the name is invalid or the prefix is not declaredCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.