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 "Vladimir I." <vi...@incap.ru> on 2004/07/14 09:36:24 UTC

Xalan 2.5.0 & 2.6.0 document function fails.

Hi all!

trouble:
when i make transformation using Templates object document() function will
not call my custom URIResolver object
ex:
<xsl:include href="/BR/convert.xslt"/>

<xsl:include href="/BR/price.xslt"/>

works fine, but
<xsl:for-each
select="document('/Admin/Order/shipping.xml')/shipping/ups/method"/>
this line do not used my Resolver :(

i set resolver on TransformerFactory object
and before transformation in Transformer object
       tFactory.setURIResolver(resolver);
       Templates templates = tFactory.newTemplates(new DOMSource(style)); //
at this time called my resolver
       Transformer transformer = templates.newTransformer();
        transformer.setURIResolver(resolver); // again because in debug mode
getURIResolver returns null :(
        transformer.transform(); // but in this time resolver do not called,
i think he must do it, isn't it?

please help me find out trouble.

ps remote debug used

------------------------------------
Vladimir I.
v-cat@yandex.ru
------------------------------------


Re: Multiple xml input

Posted by Oleg Dulin <ol...@configurecode.com>.
Here is the trick:

1) Create an XML file that contains a list of files you want to use as 
input:

<list>
   <file>foo.xml</file>
  ....
</list>

2) Write an XSL that is applied to the file from (1) and uses 
document(...) function to load files referenced in file tags.

I have it blogged at http://www.olegdulin.com/index.php?p=100&c=1

Oleg

Fabrice Mirabile wrote:

>Hi,
>
>I'm using xalanJ within a jsp to transform xml into svg or xhtml. i would
>like to know how to make a transformation from multiple xml input.
>
>xml1    xsl
>xml2   -----> Output
>xml3
>....
>
>
>thankx in advance.
>fabrice
>
>  
>


Multiple xml input

Posted by Fabrice Mirabile <f....@free.fr>.
Hi,

I'm using xalanJ within a jsp to transform xml into svg or xhtml. i would
like to know how to make a transformation from multiple xml input.

xml1    xsl
xml2   -----> Output
xml3
....


thankx in advance.
fabrice


Re: Xalan 2.5.0 & 2.6.0 document function fails.

Posted by "Vladimir I." <vi...@incap.ru>.
this example works WITHOUT Xalan in classpath

your example not worked in any my configuration, but then add one more
line....

1) then java.endorsed.dirs not set - it is using crimson or something like
from jre
2) i show packages and test this example on
    a) internal j2re1.4.2_02 parser (i don't know which one there)
    b) xalan 2.5.0 + correspond xerces (java.endorsed.dirs was set and
custom classloader was written)
    c) xalan 2.6.0 + xerces (...)

Templates temp = tf.newTemplates(new StreamSource(args[0]));

Transformer t = temp.newTransformer();

// code change there

t.setURIResolver(new Resolver());

t.transform(new StreamSource(args[1]), new StreamResult(System.out));

near transformer URIResolver must be set.
all works fine on all tested solutions
- but it is doesn't work with xalan-2.5.0 in the web server (other jre
different from 1.4.2_02 i think it is reason)
and on the server with xalan 2.6.0 all works fine!

conclusion:
problem with old jre and xalan 2.5.0


ps i think this example must work without resolver for transformer, but this
problem is not so strong
pps i am ready to add this bug in bugzilla if you are sure

----- Original Message -----
From: "Henry Zongaro" <zo...@ca.ibm.com>
To: "Vladimir I." <vi...@incap.ru>
Cc: <xa...@xml.apache.org>
Sent: Tuesday, July 27, 2004 12:42 AM
Subject: Re: Xalan 2.5.0 & 2.6.0 document function fails.


> Hi, Vladimir,
>
> "Vladimir I." <vi...@incap.ru> wrote on 07/19/2004 03:48:34 AM:
> > > "Vladimir I." <vi...@incap.ru> wrote on 07/14/2004 03:36:24 AM:
> > > > trouble:
> > > > when i make transformation using Templates object document()
> function
> > > will
> > > > not call my custom URIResolver object
> > > > ex:
> > > > <xsl:include href="/BR/convert.xslt"/>
> > > >
> > > > <xsl:include href="/BR/price.xslt"/>
> > >
> > >      This looks like a bug in Xalan-Java's implementations of the
> > > Templates interface.  Both the interpretive processor and the
> compiling
> > > processor fail to pass the URIResolver from a TransformerFactory to a
> > > Transformer if the Transformer was created from a Templates object.
> > >
> > >      Could I ask you to open a bug report in Bugzilla for this
> problem?
> > it was a bug in 2.5.0
> > when i try this in 2.6.0 - all fine (i was mistaked in previous letter)
> > it is still need to open a bug report ?
>
>      I can't explain why you don't see this problem with Xalan-J 2.6.0; I
> see it with both the interpretive processor and with XSLTC.
>
>      Try invoking the following example using this command-line:
>
> $ java Resolver dxxxxx.xsl dxxxxx.xml
>
> The Resolver.resolve method should be invoked four times, but I only see
> four calls.
>
>
>
>
> Thanks,
>
> Henry
> ------------------------------------------------------------------
> Henry Zongaro      Xalan development
> IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
> mailto:zongaro@ca.ibm.com
>

Re: Xalan 2.5.0 & 2.6.0 document function fails.

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Vladimir,

"Vladimir I." <vi...@incap.ru> wrote on 07/19/2004 03:48:34 AM:
> > "Vladimir I." <vi...@incap.ru> wrote on 07/14/2004 03:36:24 AM:
> > > trouble:
> > > when i make transformation using Templates object document() 
function 
> > will
> > > not call my custom URIResolver object
> > > ex:
> > > <xsl:include href="/BR/convert.xslt"/>
> > > 
> > > <xsl:include href="/BR/price.xslt"/>
> > 
> >      This looks like a bug in Xalan-Java's implementations of the 
> > Templates interface.  Both the interpretive processor and the 
compiling 
> > processor fail to pass the URIResolver from a TransformerFactory to a 
> > Transformer if the Transformer was created from a Templates object.
> > 
> >      Could I ask you to open a bug report in Bugzilla for this 
problem?
> it was a bug in 2.5.0
> when i try this in 2.6.0 - all fine (i was mistaked in previous letter)
> it is still need to open a bug report ?

     I can't explain why you don't see this problem with Xalan-J 2.6.0; I 
see it with both the interpretive processor and with XSLTC.

     Try invoking the following example using this command-line:

$ java Resolver dxxxxx.xsl dxxxxx.xml

The Resolver.resolve method should be invoked four times, but I only see 
four calls.




Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com

Re: Xalan 2.5.0 & 2.6.0 document function fails.

Posted by "Vladimir I." <vi...@incap.ru>.
it was a bug in 2.5.0
when i try this in 2.6.0 - all fine (i was mistaked in previous letter)
it is still need to open a bug report ?

----- Original Message ----- 
From: "Henry Zongaro" <zo...@ca.ibm.com>
To: "Vladimir I." <vi...@incap.ru>
Cc: <xa...@xml.apache.org>
Sent: Sunday, July 18, 2004 2:43 AM
Subject: Re: Xalan 2.5.0 & 2.6.0 document function fails.


> Hi, Vladimir,
> 
> 
> "Vladimir I." <vi...@incap.ru> wrote on 07/14/2004 03:36:24 AM:
> > trouble:
> > when i make transformation using Templates object document() function 
> will
> > not call my custom URIResolver object
> > ex:
> > <xsl:include href="/BR/convert.xslt"/>
> > 
> > <xsl:include href="/BR/price.xslt"/>
> 
>      This looks like a bug in Xalan-Java's implementations of the 
> Templates interface.  Both the interpretive processor and the compiling 
> processor fail to pass the URIResolver from a TransformerFactory to a 
> Transformer if the Transformer was created from a Templates object.
> 
>      Could I ask you to open a bug report in Bugzilla for this problem?
> 
> Thanks,
> 
> Henry
> ------------------------------------------------------------------
> Henry Zongaro      Xalan development
> IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
> mailto:zongaro@ca.ibm.com
> 

Re: Xalan 2.5.0 & 2.6.0 document function fails.

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Vladimir,


"Vladimir I." <vi...@incap.ru> wrote on 07/14/2004 03:36:24 AM:
> trouble:
> when i make transformation using Templates object document() function 
will
> not call my custom URIResolver object
> ex:
> <xsl:include href="/BR/convert.xslt"/>
> 
> <xsl:include href="/BR/price.xslt"/>

     This looks like a bug in Xalan-Java's implementations of the 
Templates interface.  Both the interpretive processor and the compiling 
processor fail to pass the URIResolver from a TransformerFactory to a 
Transformer if the Transformer was created from a Templates object.

     Could I ask you to open a bug report in Bugzilla for this problem?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com