cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [C2][Patch] XMLFragment (again)
Date Mon, 08 Jan 2001 08:41:39 GMT


Jeremy Quinn a écrit :
> 
> At 14:23 +0100 05/01/01, Sylvain Wallez wrote:
> >But in xsp.xsl, the content of <xsp:expr> is inserted 'as is' in the
> >source code if the parent element is an <xsp:xxx> tag other that
> ><xsp:content> and <xsp:element>. I cannot see the reason behind that.
> >Maybe Ricardo could explain.
> 
> Off the top of my head ..... I seem to remember it is so that one Tag can
> "consume" the output of another Tag, without the first Tag's content going
> to the output document. An important ability to retain IMHO.
> 
> I hope I got that right ....
> 

Sorry, but I don't understand how inserting the content of <xsp:expr>
"as is" (i.e. ignoring the <xsp:expr> tag) can help to consume the
output of another tag.

In C1, it's easy : you can play with the "document" and "xspCurrentNode"
variables. In C2 this could be achieved with "contentHandler", either by
wrapping it or by masking it with a block-local variable. In that last
case, however, we should remove all hard references to the class member
(i.e. "this.contentHandler") in xsp.xsl.

<xsl:template match="lib:inputModifier">
  XMLPipe pipe = new MyPipe(contentHandler);
  {
    // local variable hides class member or previous variable
    ContentHandler contentHandler = pipe;

    <xsl:apply-templates/>

    // end of block un-hides contentHandler
  }
</xsl:template>

Toughts about that ?

-- 
Sylvain Wallez
Anyware Technologies

Mime
View raw message