An ExpressionContext represents the context for an XPath expression written
in the stylesheet.
getBaseURI
public String getBaseURI()
Get the Base URI of the element containing the expression, for resolving any
relative URI's used in the expression.
Used by the document() function.
- getBaseURI in interface StaticContext
getCollation
public StringCollator getCollation(String name)
Get a named collation.
- getCollation in interface StaticContext
name
- The name of the required collation. Supply null to get the default collation.
- the collation; or null if the required collation is not found.
getDefaultCollationName
public String getDefaultCollationName()
Get the default collation. Return null if no default collation has been defined
- getDefaultCollationName in interface StaticContext
getDefaultElementNamespace
public String getDefaultElementNamespace()
Get the default XPath namespace for elements and types
Return NamespaceConstant.NULL for the non-namespace
- getDefaultElementNamespace in interface StaticContext
getExecutable
public Executable getExecutable()
Get the executable
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"useDefault
- Defines the action when there is no prefix. If true, use
the default namespace URI (as for element names). If false, use no namespace URI
(as for attribute names).
- -1 if the name is not already present in the name pool
getImportedSchemaNamespaces
public Set getImportedSchemaNamespaces()
Get the set of imported schemas
- getImportedSchemaNamespaces in interface StaticContext
- a Set, the set of URIs representing the names of imported schemas
getLineNumber
public int getLineNumber()
Get the line number of the expression within its containing entity
Returns -1 if no line number is available
- getLineNumber in interface StaticContext
getStructuredQName
public StructuredQName getStructuredQName(String qname,
boolean useDefault)
throws XPathException
Get a StructuredQName for a name, using this as the context for namespace resolution
qname
- The name as written, in the form "[prefix:]localname"useDefault
- Defines the action when there is no prefix. If true, use
the default namespace URI (as for element names). If false, use no namespace URI
(as for attribute names).
- -1 if the name is not already present in the name pool
getStyleElement
public StyleElement getStyleElement()
Get the stylesheet element containing this XPath expression
- the element in the tree representation of the source stylesheet
getSystemId
public String getSystemId()
Get the System ID of the entity containing the expression (used for diagnostics)
- getSystemId in interface StaticContext
getURIForPrefix
public String getURIForPrefix(String prefix)
throws XPathException
Get the URI for a prefix, using this Element as the context for namespace resolution.
The default namespace will not be used when the prefix is empty.
- getURIForPrefix in interface StaticContext
getXSLStylesheet
public XSLStylesheet getXSLStylesheet()
Get the XSLStylesheet object
- the XSLStylesheet object representing the outermost element of the stylesheet module
isAllowedBuiltInType
public boolean isAllowedBuiltInType(BuiltInAtomicType type)
Determine whether a built-in type is available in this context. This method caters for differences
between host languages as to which set of types are built in.
- isAllowedBuiltInType in interface StaticContext
type
- the supposedly built-in type. This will always be a type in the
XS or XDT namespace.
- true if this type can be used in this static context
isImportedSchema
public boolean isImportedSchema(String namespace)
Test whether a schema has been imported for a given namespace
- isImportedSchema in interface StaticContext
namespace
- the target namespace of the required schema
- true if a schema for this namespace has been imported
issueWarning
public void issueWarning(String s,
SourceLocator locator)
Issue a compile-time warning
- issueWarning in interface StaticContext