public class StandardOutputResolver extends java.lang.Object implements OutputURIResolver
Constructor and Description |
---|
StandardOutputResolver() |
Modifier and Type | Method and Description |
---|---|
void |
close(javax.xml.transform.Result result)
Signal completion of the result document.
|
protected javax.xml.transform.Result |
createResult(java.net.URI absoluteURI) |
static StandardOutputResolver |
getInstance()
Get a singular instance
|
static javax.xml.transform.Result |
makeOutputFile(java.net.URI absoluteURI)
Create an output file (unless it already exists) and return a reference to it as a Result object
|
StandardOutputResolver |
newInstance()
Get an instance of this OutputURIResolver class.
|
javax.xml.transform.Result |
resolve(java.lang.String href,
java.lang.String base)
Resolve an output URI
|
public static StandardOutputResolver getInstance()
public StandardOutputResolver 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.
This OutputURIResolver is stateless (that is, it retains no information between resolve() and close()), so 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.
newInstance
in interface OutputURIResolver
public javax.xml.transform.Result resolve(java.lang.String href, java.lang.String base) throws XPathException
resolve
in interface OutputURIResolver
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,
normally the URI of the principal output file.XPathException
protected javax.xml.transform.Result createResult(java.net.URI absoluteURI) throws XPathException, java.io.IOException
XPathException
java.io.IOException
public static javax.xml.transform.Result makeOutputFile(java.net.URI absoluteURI) throws XPathException
absoluteURI
- the URI of the output file (which should use the "file" schemeXPathException
public void close(javax.xml.transform.Result result) throws XPathException
close
in interface OutputURIResolver
result
- The result object returned by the previous call of resolve()XPathException
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.