net.sf.saxon.sxpath
public abstract class AbstractStaticContext extends Object implements StaticContext
This class implements those parts of the functionality of a static context that tend to be common to most implementations: simple-valued properties such as base URI and default element namespace; availability of the standard function library; and support for collations.
Method Summary | |
---|---|
protected void | addFunctionLibrary(FunctionLibrary library)
Add a function library to the list of function libraries |
void | declareCollation(String name, StringCollator comparator, boolean isDefault)
Declare a named collation |
String | getBaseURI()
Get the Base URI, for resolving any relative URI's used
in the expression. |
StringCollator | getCollation(String name)
Get a named collation. |
int | getColumnNumber()
Return the character position where the current document event ends. |
Configuration | getConfiguration()
Get the system configuration |
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 | getDefaultElementNamespace()
Get the default namespace URI for elements and types
Return NamespaceConstant.NULL (that is, the zero-length string) for the non-namespace |
String | getDefaultFunctionNamespace()
Get the default function namespace.
|
Executable | getExecutable()
Get the Executable (representing a complete stylesheet or query) |
FunctionLibrary | getFunctionLibrary()
Get the function library containing all the in-scope functions available in this static
context. |
int | getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
|
int | getLineNumber()
Get the line number of the expression within that container.
|
LocationMap | getLocationMap() |
LocationProvider | getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamePool | getNamePool()
Get the NamePool used for compiling expressions |
String | getPublicId()
Return the public identifier.
|
String | getSystemId()
Get the system ID of the container of the expression. |
boolean | isAllowedBuiltInType(BuiltInAtomicType type)
Determine whether a built-in type is available in this context. |
boolean | isInBackwardsCompatibleMode()
Determine whether Backwards Compatible Mode is used |
void | issueWarning(String s, SourceLocator locator)
Issue a compile-time warning. |
XPathContext | makeEarlyEvaluationContext()
Construct a dynamic context for early evaluation of constant subexpressions |
void | setBackwardsCompatibilityMode(boolean compatible)
Set XPath 1.0 compatibility mode on or off (by default, it is false) |
void | setBaseURI(String baseURI)
Set the base URI in the static context |
protected void | setConfiguration(Configuration config)
Set the Configuration. |
void | setDefaultElementNamespace(String uri)
Set the default namespace for elements and types |
protected void | setDefaultFunctionLibrary()
Initialize the default function library for XPath.
|
void | setDefaultFunctionNamespace(String uri)
Set the default function namespace |
void | setFunctionLibrary(FunctionLibrary lib)
Set the function library to be used |
void | setLocationMap(LocationMap locationMap)
Set the location map, which is used for translating location identifiers into URIs and line
numbers |
Parameters: library the function library to be added
Parameters: name The name of the collation (technically, a URI) comparator The StringCollator used to implement the collating sequence isDefault True if this is to be used as the default collation
Returns: "" if no base URI has been set
Returns: the collation identified by the given name, as set previously using declareCollation. Return null if no collation with this name is found.
Returns: -1 (no column number is available).
See Also: AbstractStaticContext
Returns: the decimal format manager for this static context, or null if named decimal formats are not supported in this environment.
Since: 9.2
Returns: the name of the default collation; or the name of the codepoint collation if no default collation has been defined
Returns: the default namespace for elements and type
Returns: the default namesapce for functions
Returns: the executable
Returns: the value XPATH
Returns: -1 always
Returns: the LocationProvider that translates location identifiers into URIs and line numbers
The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
Returns: null (always).
See Also: AbstractStaticContext
Returns: "" always
Parameters: type the supposedly built-in type. This will always be a type in the XS namespace.
Returns: true if this type can be used in this static context
Returns: true if XPath 1.0 backwards compatibility has been selected (by default, it is false)
Parameters: compatible true if XPath 1.0 compatibility mode is to be set to true, false if it is to be set to false.
Parameters: baseURI the base URI of the expression
Parameters: config the configuration
Parameters: uri the namespace to be used for unprefixed element and type names. The value "" (or NamespaceConstant.NULL) represents the non-namespace
Parameters: uri the namespace to be used for unprefixed function names. The value "" (or NamespaceConstant.NULL) represents the non-namespace
Parameters: lib the function library
Parameters: locationMap the location map to be used