Evan Lenz wrote:
> The only other
> unresolved issue with the current build (for me) is how to implement my
> simple ProcessorSpecific interface (see earlier message in thread).

Evan --

Joe, please jump in here if I'm getting myself into trouble.

All of the source trees are under the control of a single DTMManager
which supervises the creation of a DTM.  A DTM is basically a collection
of a bunch of arrays mostly containing ints that represent various
characteristics of the input document.  The DTM Manager organizes which
ints belong to which DTMs.  To determine the meaning of the ints the DTM
Manager needs to direct them to the appropriate DTM.

Why am I mentioning this?

The DTMManager gets destroyed and recreated for each transform.  As far
as I know, currently, there is no capability to serialize the DTM once
it is built and then deserialize it under a new DTMManager.  Even if
there was, we don't currently have a DTMSource so I'm not sure how the
transformer would use it.

For your getPreparedSource, the best thing that I can think of at the
moment is to just return the input Source.  This basically means no
preprocessing of the input documents.  I think it would be some work to
add a DTMSource and make the DTMs savable under one DTMManager and
restorable under another.  We'd also need to add a DTMSource into
TransformerImpl to handle it.  It might just be faster to rebuild them! 
At any rate, I don't see that capability in the immediate future.  Maybe
Joe can shed some light on this or Scott can elaborate upon his return
from vacation.

For your getNodeSet, we have the same problem.  for now, you could just
use the following code:

  public Object getNodeSet(Hashtable database)
        throws Exception
    {
        NodeSet mns = new NodeSet();

        Enumeration e = database.elements();
        while (e.hasMoreElements())
        {
            Source source = (Source)e.nextElement();
            mns.addElement(source.getNode());
        }

        return nodeSet;
    }

I guess you must have an application with a large number of documents
that you are selecting between a lot with the document() function.  If
it's any consolation, SourceTreeManager will cache the various input
documents so that once they're built for a given transform, they
shouldn't have to be rebuilt but can be readily accessed right from the
cache.  The caching is done by systemId so be sure that that is set in
the Source for your input documents.

HTH,
Gary

Reply via email to