Your solution only works when the "if" is true for the first loop
iteraction. After that new child elements have been created and the attribute
won't be placed where I want to.
A working solution is -- don't try to understand the source code, just look
at the generated XML (grab your underware) :
<dates>
<xsp:logic>
ResultSet rsDates = <esql:get-resultset/>;
while(rsDates.next())
{
if (rsDates.getString(1).equals(today)
{
currentDate = today;
}
(...)
//
I'm storing the rsDates here in an ArrayList
(...)
} <xsp:attribute name="current"><xsp:expr>currentDate</xsp:expr></xsp:attribute>
<!-- GRAB YOUR UNDERWARE
-->
</xsp:logic> <xsp:logic>
<!-- GRAB YOUR UNDERWARE
-->
iter = listDates.listIterator(); while(iter.hasNext()) { <date_sel><xsp:expr>(String)iter.next()</xsp:expr></date_sel>; } </xsp:logic> </dates> generated XML *without* the
</xsp:logic><xsp:logic> tags between the <!--
GRAB YOUR UNDERWARE --> comments.
===================================================================================
<date_sel current="30-12-2002">30-12-2002</date_sel>
<dates> </dates>
generated XML *with* the
</xsp:logic><xsp:logic> tags between the <!--
GRAB YOUR UNDERWARE --> comments.
=================================================================================== <dates current="30-12-2002">
<date_sel >30-12-2002</date_sel>
</dates>
-----Mensagem original-----
De: Jim Bearce [mailto:[EMAIL PROTECTED]] Enviada: ter 31-12-2002 14:13 Para: [EMAIL PROTECTED] Cc: Luís Góis Assunto: Re: xsp:attribute generating a new element instead of an attribute in an already existing element
|
Title: Re: xsp:attribute generating a new element instead of an attribute in an already existing element
- xsp:attribute generating a new element instead of an attrib... Luís Góis
- Re: xsp:attribute generating a new element instead of ... Jim Bearce
- RE: xsp:attribute generating a new element instead... Luis Gois
- Re: xsp:attribute generating a new element ins... Joerg Heinicke
- RE: xsp:attribute generating a new element instead of ... Luís Góis
- Re: xsp:attribute generating a new element instead of ... Luís Góis
- RE: xsp:attribute generating a new element instead of ... Luís Góis