[jdom-interest] URIResolver and JDOMSource

Robert Koberg rob at koberg.com
Thu Nov 7 12:55:48 PST 2002


Just got JDOM this morning and most everything is working fine. The only problem
I seem to be having is when I try to return JDOMSource for an XML doc that is
determined by an URIResolver. I did a search in the searchable archives and
browsed through a few months of posts but did not see anything addressing this.

I am trying to cache some  XML as JDOM Documents. When an XSLT requests the file
through something like
<xsl:apply-templates select="document('users.xml')/users"/>
The resolvers returns the JDOMSource. I believe I am returning the JDOMSource to
the transformation. At least at the line before I return the JDOMSource the
correct Document is there. It kinda looks like this:

public Source resolve(String href,String base) {
  XmlSourceManager srcman = Controller.source_manager;
  if (href.equals("users.xml")) {
System.out.println("srcman.getUsers(): " + srcman.getUsers());
    // srcman.getUsers() returns the users.xml as a Document
    return new JDOMSource(srcman.getUsers());
  return null;

I was hoping someone else has done this and I making a stupid mistake. I am
using Caucho's Resin servlet container and using their custom XSL compiler (it
is kind of like Xalan's XSLTC). URI resolution is supposed to work like Saxon's.
Before I go off and try this in other processors I wanted to ask here first.

Any help would be greatly appreciated - Thanks!

                                 Robert Koberg
                                 San Francisco

More information about the jdom-interest mailing list