You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Martin Man <Ma...@seznam.cz> on 2001/05/02 19:12:46 UTC

[c2] esql.xsl versus problem

Hi all,

the following esql fragment produces something strange
------------------------------------------------------

<esql:row-results>
  <column>
    <xsp:attribute name="xxx"></xsp:attribute>

    <xsp:logic>
      if ("blabla".equals (<esql:get-string column="blablabla"/>) {
        <xsp:attribute name="yyy"></xsp:attribute>
      }
    </xsp:logic>

  </column>
</esql:row-results>

the code
--------

while (resultSet.next ()) {

  contentHandler.addAttribute ("xxx");
  contentHandler.startElement ("column");

  if ("blabla".equals (......) {
    contentHandler.addAttribute ("yyy"); // This attribute goes to next row
  }

  contentHandler.endElement ("column");

}

the addAtribute inside of <xsp:logic> goes out after startElement, and
therefore is not created in proper <column> element (if I understand it
correctly), is this a bug ????


thanx,
martin

P.S. source code simplified :))

-- 
-------------------------------------------------------------------------------
"Only dead fish swims with a stream"
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

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


Re: [c2] esql.xsl versus problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 2 May 2001, Martin Man wrote:

> the following esql fragment produces something strange
> ------------------------------------------------------
>
> <esql:row-results>
>   <column>
>     <xsp:attribute name="xxx"></xsp:attribute>
>
>     <xsp:logic>
>       if ("blabla".equals (<esql:get-string column="blablabla"/>) {
>         <xsp:attribute name="yyy"></xsp:attribute>
>       }
>     </xsp:logic>
>
>   </column>
> </esql:row-results>
>
> the code
> --------
>
> while (resultSet.next ()) {
>
>   contentHandler.addAttribute ("xxx");
>   contentHandler.startElement ("column");
>
>   if ("blabla".equals (......) {
>     contentHandler.addAttribute ("yyy"); // This attribute goes to next row
>   }
>
>   contentHandler.endElement ("column");
>
> }
>
> the addAtribute inside of <xsp:logic> goes out after startElement, and
> therefore is not created in proper <column> element (if I understand it
> correctly), is this a bug ????

yeah, it's a bug. the problem is due to the way SAX handles attributes,
since you have to set them all before you can start the element. the
current xsp engine allows xsp:attributes immediately after the element,
but anything else between the element and the xsp:attribute will mess it
up. suggestions for how to fix this are welcome. :)

- donald


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