public interface OutputURIResolver
Modifier and Type | Method and Description |
---|---|
void |
close(Result result)
Signal completion of the result document.
|
OutputURIResolver |
newInstance()
Get an instance of this OutputURIResolver class.
|
Result |
resolve(String href,
String base)
Resolve an output URI.
|
OutputURIResolver newInstance()
This method is called every time an xsl:result-document instruction is evaluated (with an href attribute). The resolve() and close() methods will be called on the returned instance.
Note that in Saxon-EE, the xsl:result-document instruction executes asynchronously, which means that documents are not necessarily closed in the order they are opened, and multiple documents may be open at once.
If the OutputURIResolver is stateless (that is, it retains no information between resolve() and close()), then the same instance can safely be returned each time. For a stateful OutputURIResolver, it must either take care to be thread-safe (handling multiple invocations of xsl:result-document concurrently), or it must return a fresh instance of itself for each call.
Result resolve(String href, String base) throws TransformerException
href
- The relative URI of the output document. This corresponds to the
href attribute of the xsl:result-document instruction.base
- The base URI that should be used. This is the Base Output URI, typically
the URI of the principal output documentThe systemId property of the returned Result object should normally be the result of resolving href (as a relative URI) against the value of base. This systemId is used to enforce the error conditions in the XSLT specification that disallow writing two result trees to the same destination, or reading from a destination that is written to in the same transformation. Setting the systemId to null, or to a deceptive value, will defeat these error checks (which can sometimes be useful). Equally, setting the systemId to the same value on repeated calls when different href/base arguments are supplied will cause a spurious error.
TransformerException
- if any error occursvoid close(Result result) throws TransformerException
result
- The result object returned by the previous call of resolve()TransformerException
- if any error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.