This interface provides access to methods whose implementation depends on the chosen platform
(typically Java or .NET)
addFunctionLibraries
public void addFunctionLibraries(FunctionLibraryList list,
Configuration config)
list
- the function library list that is to be extendedconfig
- the Configuration
canReturnCollationKeys
public boolean canReturnCollationKeys(StringCollator collation)
Given a collation, determine whether it is capable of returning collation keys.
The essential property of collation keys
is that if two values are equal under the collation, then the collation keys are
equal under the equals() method.
collation
- the collation being examined, provided as a Comparator
- true if this collation can supply collation keys
compileRegularExpression
public RegularExpression compileRegularExpression(CharSequence regex,
int xmlVersion,
int syntax,
CharSequence flags)
throws XPathException
Create a compiled regular expression
regex
- the source text of the regular expression, in XML Schema or XPath syntaxxmlVersion
- version of XML in use (1.0 or 1.1)syntax
- flags
- the flags argument as supplied to functions such as fn:matches(), in string form @throws XPathException if the syntax of the regular expression or flags is incorrect @return the compiled regular expression
declareJavaClass
public void declareJavaClass(FunctionLibrary library,
String uri,
Class theClass)
Register a namespace-to-Java-class mapping declared using saxon:script in an XSLT stylesheet
library
- the library to contain the function, which must be a JavaExtensionLibraryuri
- the namespace of the function nametheClass
- the Java class that implements this namespace
getCollationKey
public Object getCollationKey(NamedCollation namedCollation,
String value)
Given a collation, get a collation key. The essential property of collation keys
is that if two values are equal under the collation, then the collation keys are
equal under the equals() method.
namedCollation
- the collation in usevalue
- the string whose collation key is required
- a representation of the collation key, such that two collation keys are
equal() if and only if the string values they represent are equal under the specified collation.
getExternalObjectType
public SchemaType getExternalObjectType(Configuration config,
String uri,
String localName)
Get a SchemaType representing a wrapped external (Java or .NET) object
config
- the Saxon Configurationuri
- the namespace URI of the schema typelocalName
- the local name of the schema type
- the SchemaType object representing this type
getParserSource
public Source getParserSource(Configuration config,
StreamSource input,
int validation,
boolean dtdValidation,
int stripspace)
Convert a StreamSource to either a SAXSource or a PullSource, depending on the native
parser of the selected platform
config
- the Saxon Configurationinput
- the supplied StreamSourcevalidation
- required validation mode, for example Validation.STRICTdtdValidation
- true if DTD-based input validation is requiredstripspace
- option for whitespace-stripping (ALL, NONE, or IGNORABLE)
- the PullSource or SAXSource, initialized with a suitable parser, or the original
input Source, if now special handling is required or possible
getPlatformSuffix
public String getPlatformSuffix()
Get a suffix letter to add to the Saxon version number to identify the platform
- "J" for Java, "N" for .NET
getPlatformVersion
public String getPlatformVersion()
Get the platform version
- the version of the platform, for example "Java version 1.5.09"
initialize
public void initialize(Configuration config)
Perform platform-specific initialization of the configuration
config
- the Saxon Configuration
isDotNet
public boolean isDotNet()
Return true if this is the .NET platform
- true if this is the .NET platform
isJava
public boolean isJava()
Return true if this is the Java platform
- true if this is the Java platform
makeAbsolute
public URI makeAbsolute(String relativeURI,
String base)
throws URISyntaxException
Construct an absolute URI from a relative URI and a base URI
relativeURI
- the relative URI. Null is permitted provided that the base URI is an absolute URIbase
- the base URI
makeCollation
public StringCollator makeCollation(Configuration config,
Properties props,
String uri)
throws XPathException
Obtain a collation with a given set of properties. The set of properties is extensible
and variable across platforms. Common properties with example values include lang=ed-GB,
strength=primary, case-order=upper-first, ignore-modifiers=yes, alphanumeric=yes.
Properties that are not supported are generally ignored; however some errors, such as
failing to load a requested class, are fatal.
config
- the configuration objectprops
- the desired properties of the collationuri
- the collation URI
- a collation with these properties
makeExtensionLibrary
public void makeExtensionLibrary(Configuration config)
Make the default extension function library (or libraries) appropriate to the platform,
and register them with the Configuration. Note that this does not actually add the libraries
to any library list.
config
- the Saxon Configuration