You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Chris Scott <sc...@gmail.com> on 2005/10/13 21:59:26 UTC

Multiple in-memory input documents...

Forgive me if this had been discuss before.

I'd like to be able to access multiple in-memory documents (ie DOM)
via the document function.  Something like document('dom://input2') or
the like.  I was wondering if there was some extention or vodoo magic
in order to accomplish this.

I found a post at
http://www.xslt.com/html/xsl-list/2002-09/msg00644.html outlining
possible implementation choices, but since it's been three years since
this post, I though I'd ask around.

Is there, at present, any predefined way to do this, or am I stuck
writing an extention.

Thanks,

~Chris

Re: Multiple in-memory input documents...

Posted by Joseph Kesselman <ke...@us.ibm.com>.
I don't think anything has changed recently. The three approaches that
occur to me offhand are:

1) Plug in an Entity Resolver which knows how to map your special URIs to
your in-memory documents. This has the advantage that it will cache the DTM
accessors for each URI so repeated references will not do additional work.

2) Or write an extension function that returns the in-memory documents as
DOM nodes; Xalan will wrap DTMs around them before using them. This may be
more expensive since it produces a new DTM wrapper each time, but...

3) Or,  if you know in advance which in-memory documents you're going to
use, you could pass them in as parameters, and once again Xalan should wrap
and use them appropriately.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk