cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@dff.st>
Subject RE: XSP bug?
Date Fri, 11 Jan 2002 08:53:12 GMT
On Thu, 10 Jan 2002, Vadim Gritsenko wrote:

> > From: Torsten Curdt [mailto:tcurdt@dff.st]
> >
> > > <xsp:logic>
> > >    Enumeration e = request.getHeaderNames();
> > >    if ((e != null) && (e.hasMoreElements())) {
> > >     <p>Here are the request headers...
> > >
> > > There is no escaping here! XSP automagically switches from Java to
> > > content once any tag or <xsp:content> is found.
> >
> > Yes... but in C2 only for the first tag! Already found the
> > caveat in the xsp.xsl!
>
> You lost me here! Do you mean second <p> would require <xsp:content>
> inside?

On my way home I realized I did not make myself clear. Too late,
too much work ;) Let's give another try:

The current implementation shows the following behaviour for
text nodes:

  ...
  <p>
    <xsp:logic>
    text nodes are java code - OK
      <p>
        text nodes are copied as text nodes - WRONG?
        in order to write java here you have open
        another xsp:logic tag. (AFAIR that's not how it
        was in C1 - look at the C1 docs)
        <xsp:logic>
          text nodes are java code - OK
        </xsp:logic>
     </p>
   </xsp:logic>
  </p>
  ...

You will get these problems only if you create tags inside
a xsp:logic section and want to write more nested java code. Clear?
So is this behaviour correct or not?

(You might also look at the esql.xsl)

I'd like to have only *ONE* xsp:logic tag meaning all descending text
nodes are java. If you want to switch back to normal processing you have
to use xsp:content to be back in copy mode.

Like this:

  ...
  <p>
    <xsp:logic>
     if (request.getParameter("test")) {
       <p>
         String test = request.getParameter("test");
         <param><xsp:expr>test</xsp:expr></param>

         <xsp:content>
           <info>info text</info>
         </xsp:content>

         // or

         <info><xsp:content>info text</xsp:content></info>

       </p>
     }
    </xsp:logic>

What do you think?


BTW:
I realize that there is also a xsp:text. Can someone please
explain the difference between xsp:text and xsp:content. AFAICS it's
only used inside xsp:attribute. Maybe this supposed to be xsp:content,
too?
--
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message