You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@multitask.com.au on 2002/11/20 07:27:24 UTC

[jelly] [jsl] applyTemplates 'loses' the XMLOutput context

When using a stylesheet it is *very* handy to be able to put the result of 
a stylesheet into a variable or file.

If a jsl:template has a core:file or core:set tag as the parent of the 
applyTemplates, the output of the template processing is 'lost', i.e. 
displayed on the screen, not sent to the file or variable.

I've updated the suite.jelly for jsl's tests to show the 'bug'.

Anyone out there who can suggest a workaround or fix?
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [jelly] [jsl] applyTemplates 'loses' the XMLOutput context

Posted by di...@multitask.com.au.
Man, you fix these things faster than I can investigate them :)

Thanks again!

"James Strachan" <ja...@yahoo.co.uk> wrote on 21/11/2002 09:22:24 
AM:

> Hi dIon
> 
> From: <di...@multitask.com.au>
> > When using a stylesheet it is *very* handy to be able to put the 
result of
> > a stylesheet into a variable or file.
> >
> > If a jsl:template has a core:file or core:set tag as the parent of the
> > applyTemplates, the output of the template processing is 'lost', i.e.
> > displayed on the screen, not sent to the file or variable.
> >
> > I've updated the suite.jelly for jsl's tests to show the 'bug'.
> >
> > Anyone out there who can suggest a workaround or fix?
> 
> Thanks again for a great JellyUnit test case to demonstrate this bug.
> 
> This bug was due to the Stylesheet not maintaining the current XMLOutput
> used when <applyTemplates> is invoked with a different XMLOutput to the 
one
> when the <style> tag was invoked. The way <j:set> works is by invoking 
its
> body into a new XMLOutput buffer which is why the variables weren't 
being
> set correctly.
> 
> I've patched the code to fix this bug and added a few extra JellyUnit 
tests
> for good measure to ensure this is truly licked.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [jelly] [jsl] applyTemplates 'loses' the XMLOutput context

Posted by James Strachan <ja...@yahoo.co.uk>.
Hi dIon

From: <di...@multitask.com.au>
> When using a stylesheet it is *very* handy to be able to put the result of
> a stylesheet into a variable or file.
>
> If a jsl:template has a core:file or core:set tag as the parent of the
> applyTemplates, the output of the template processing is 'lost', i.e.
> displayed on the screen, not sent to the file or variable.
>
> I've updated the suite.jelly for jsl's tests to show the 'bug'.
>
> Anyone out there who can suggest a workaround or fix?

Thanks again for a great JellyUnit test case to demonstrate this bug.

This bug was due to the Stylesheet not maintaining the current XMLOutput
used when <applyTemplates> is invoked with a different XMLOutput to the one
when the <style> tag was invoked. The way <j:set> works is by invoking its
body into a new XMLOutput buffer which is why the variables weren't being
set correctly.

I've patched the code to fix this bug and added a few extra JellyUnit tests
for good measure to ensure this is truly licked.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>