You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roger Vaughn <rv...@seaconinc.com> on 2000/04/09 17:17:21 UTC
Multiple Levels of XSP
I'm trying to put together a page that will run through the XSP
processor *after* going through the XSLT processor. What is the best
way to go about doing this?
Here's the complete scenario: I start with an XSP page that dynamically
includes a pure-data (read, no Cocoon headers) XML page. This then gets
processed by XSLT (driven by headers in the XSP page) to produce HTML
output. I would like to process this HTML through XSP *again*, because
I expect it to contain a few expressions from XSP taglibs. After the
second XSP, the output should be browser ready.
I'm going about things this way to keep a clear separation of
responsibilities. The XSLT sheet can be coded by web coders, who can be
expected to understand XSP taglib tags. These tags are part of the
presentation, not the content, and therefore don't seem to make sense
earlier in the process. The XSP sheets and the XSP taglibs themselves
can be coded by Java coders, who may not understand the final
presentation.
Is there perhaps a better way to accomplish what I'm trying?
To quote the anonymous original author, this stuff rocks. I had just
started using JSPs, but after finding Cocoon, I have already given them
up!
Re: Multiple Levels of XSP
Posted by Roger Vaughn <rv...@seaconinc.com>.
Stefano Mazzocchi wrote:
>
> Hmmm, the idea of multiple XSP is not that great.
Ok, I'll buy that. It didn't seem ideal from a performance standpoint,
either. There are definitely other ways around it, like encapsulating
the original XML data inside of a "master" node containing the data that
was to end up in the second XSP.
BTW, I did try this anyway (poorly, I'm sure), and ended up with some
sort of infinite loop thingy - the XSLT invokes an XSP which invokes the
XSLT which invokes the XSP.......
> > Is there perhaps a better way to accomplish what I'm trying?
>
> It seems to me you want to:
>
> 1) include data with XSP
> 2) transform it into something + XSP
> 3) execute it
> 4) transform it into HTML
>
> is this right?
Yah, that's close. This is the summary:
1) include data with XSP (solely to avoid Cocoon headers in the data)
2) transform it into HTML with embedded XSP tags (but no logic blocks)
3) resolve the remaining XSP tags
My "second XSP" step was intended solely to accomplish #3.
> Ok, then the problem is 1) which should be done _without_ the need for
> XSP.... the problem is that you probably need to wait for Cocoon2 and
> the XInclude filter to see this happening...
I'll buy that. I'll wait expectantly. :-) Meanwhile this is just a
diversion and is hardly necessary for the bulk of what I need.
Thanks for the great feedback!
roger
Re: Multiple Levels of XSP
Posted by Stefano Mazzocchi <st...@apache.org>.
Roger Vaughn wrote:
>
> I'm trying to put together a page that will run through the XSP
> processor *after* going through the XSLT processor. What is the best
> way to go about doing this?
>
> Here's the complete scenario: I start with an XSP page that dynamically
> includes a pure-data (read, no Cocoon headers) XML page. This then gets
> processed by XSLT (driven by headers in the XSP page) to produce HTML
> output. I would like to process this HTML through XSP *again*, because
> I expect it to contain a few expressions from XSP taglibs. After the
> second XSP, the output should be browser ready.
Hmmm, the idea of multiple XSP is not that great.
> I'm going about things this way to keep a clear separation of
> responsibilities. The XSLT sheet can be coded by web coders, who can be
> expected to understand XSP taglib tags. These tags are part of the
> presentation, not the content, and therefore don't seem to make sense
> earlier in the process. The XSP sheets and the XSP taglibs themselves
> can be coded by Java coders, who may not understand the final
> presentation.
This is the whole deal of XSP taglibs but has anything to do with
multiple XSP passes.
> Is there perhaps a better way to accomplish what I'm trying?
It seems to me you want to:
1) include data with XSP
2) transform it into something + XSP
3) execute it
4) transform it into HTML
is this right?
Ok, then the problem is 1) which should be done _without_ the need for
XSP.... the problem is that you probably need to wait for Cocoon2 and
the XInclude filter to see this happening...
...or maybe you could try with external entities.
> To quote the anonymous original author, this stuff rocks. I had just
> started using JSPs, but after finding Cocoon, I have already given them
> up!
:)
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------