|
Nux 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentURIResolver
Called by the XQuery processor to turn a URI passed to the XQuery doc()
function into a XOM Document
object.
This interface allows to intercept and customize URI resolution. For example
here one can plugin XML schema validation, constraint checking, XIncluder
,
streaming path filters such as StreamingPathFilter
,
other preprocessing steps, and/or document caching (e.g. using
BinaryXMLCodec
with DocumentPool
,
EHCache, OSCache or similar products).
Via a ResourceResolver
one might also read a document from the web,
a classpath, a jar file, a war file, a JDBC database, a JNDI context/data
source, or similar.
This callback interface is just like the
URIResolver
interface, except that it returns a
Document
instead of a Source
object.
For example, a simple implementation could look like this:
String systemID = new net.sf.saxon.StandardURIResolver().resolve(href, baseURI).getSystemId(); return BuilderPool.GLOBAL_POOL.getBuilder(false).build(systemID); //return BuilderPool.GLOBAL_POOL.getW3CBuilder(...).build(systemID); // a variant using a document pool: String systemID = new net.sf.saxon.StandardURIResolver().resolve(href, baseURI).getSystemId(); return DocumentPool.GLOBAL_POOL.getDocument(new URI(systemID));
Method Summary | |
---|---|
Document |
resolve(String href,
String baseURI)
Called by the XQuery processor when it encounters a doc() function. |
Method Detail |
---|
Document resolve(String href, String baseURI) throws ParsingException, IOException, TransformerException
doc()
function.
href
- An href attribute, which may be relative or absolute.baseURI
- The (absolute) base URI in effect when the href attribute was
encountered.
ParsingException
- if an error occurs when trying to resolve the URI.
IOException
- if an error occurs when trying to resolve the URI.
TransformerException
- if an error occurs when trying to resolve the URI.
|
Nux 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |