Class URIResolverImpl
java.lang.Object
|
+--URIResolverImpl
- All Implemented Interfaces:
- javax.xml.transform.URIResolver
- public class URIResolverImpl
- extends java.lang.Object
- implements javax.xml.transform.URIResolver
An example URIResolver for XMLDB-compliant databases. Note, don't
use this in a production system, rather use it as an example for
writing a decent resolver of your own.
This resolver accepts URIs with a 'xmldb' schema and an empty
authority [host], it does not resolve relative hrefs against
any given base, so all URIs handed to it must be absolute.
For example: xmldb:///foo/bar.xml
Constructor Summary |
URIResolverImpl(org.xmldb.api.base.Collection aRootCollection)
Constructs a new URIResolver. |
Method Summary |
static void |
main(java.lang.String[] args)
Self test / demo. |
javax.xml.transform.Source |
resolve(java.lang.String aHref,
java.lang.String aBase)
Resolves a href to an XML document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URIResolverImpl
public URIResolverImpl(org.xmldb.api.base.Collection aRootCollection)
- Constructs a new URIResolver.
- Parameters:
aRootCollection
- a non-null Collection which
will be used as the root collection when resolving URIs.
resolve
public javax.xml.transform.Source resolve(java.lang.String aHref,
java.lang.String aBase)
throws javax.xml.transform.TransformerException
- Resolves a href to an XML document.
- Specified by:
resolve
in interface javax.xml.transform.URIResolver
main
public static void main(java.lang.String[] args)
Self test / demo. Requires five parameters (in order):
- XMLDB database class name
- XMLDB root collection URI
- source XML file
- transform XSLT file
- result XML file