← Prev in month ← Prev in thread

Proposals to improve xalan extension: com.nwalsh.xalan.Text

From
Blexander Larnstedt
Date
2003-09-13T14:27:49+00:00
ID
Thread
Proposals to improve xalan extension: com.nwalsh.xalan.Text
I find the ability to reference external text data really useful. But I had 
to struggle with some problems according the appropriate extension class 
»com.nwalsh.xalan.Text« to get it to work for me. So here are my experiences:

First, returning a NodeSet object (of TextNodes) gives me an error from 
Xalans DTMManager (Data Type Mapping?). So I had to redesign the insertfile 
method to return a string object instead.

Second: what is the base directory for relative paths in the 
texdata/fileref attribute? I think its simply taken from wherever you start 
Xalan. But this seems to be wrong - shouldn't the base (defaultly) be equal 
to that directory where the including document resides?
However, I've would propose to use the URIResolver object to resolve the 
full URL,

in »com.nwalsh.xalan.Text«, instead of:

       fileURL = new URL(href);

I used this:

       this.href = getFilename(context, elem);
       String base = context.getTransformer().getBaseURLOfSource();
       javax.xml.transform.URIResolver resolver = 
context.getTransformer().getURIResolver();
       javax.xml.transform.Source source = this.resolver.resolve(this.href, 
this.base);
       this.hrefSystemID = source.getSystemId();
       ....
       fileURL = new URL(this.hrefSystemID);

Regards,
Alex

PS: Using docbook-xsl 1.61.3, Xalan 2.5.1
← Prev in month ← Prev in thread