cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: [c2] esql.xsl <esql:row-results> versus <xsp:logic> problem
Date Wed, 02 May 2001 18:30:01 GMT
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


Mime
View raw message