Hello,
I use Apache Tomcat/4.0.4 + Cocoon 2.0.3
I queries a DB via ODBC, xsp et esql.I would like to group the result on a certain tag. My code is the following.
<esql:query>
SELECT idTopic, valeur
FROM Topic LEFT JOIN TopicName ON Topic.idTopic = TopicName.isTopicName
WHERE
idTopic IN
(
SELECT instance_fiche_minidoc.rolePlayingTopic
FROM AssociationRole AS instance_fiche_minidoc, AssociationRole AS type_fiche_minidoc
WHERE
instance_fiche_minidoc.type = 'PSI_SAM_Instance'
AND
type_fiche_minidoc.type = 'PSI_SAM_Type'
AND
type_fiche_minidoc.rolePlayingTopic = 'PSI_FicheMinidoc'
AND
type_fiche_minidoc.isRole = instance_fiche_minidoc.isRole
)
</esql:query>
<esql:results>
<esql:row-results>
<Fiches>
<esql:group group-on="idTopic">
<Fiche>
<xsp:attribute name="id"><esql:get-string column="idTopic"/></xsp:attribute>
<esql:member>
<Name><esql:get-string column="valeur"/></Name>
</esql:member>
</Fiche>
</esql:group>
</Fiches>
</esql:row-results>
</esql:results>
In brief, my object Topic has a property idTopic, and this object may have many TopicName with the property "valeur". I would like to make a group on the object Topic. In final, I would like to have the following tag sequence :
<Fiche id="xxxx">
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
</Fiche>
<Fiche id="xxxx">
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
<Name>xxxxxxxxxxxx</Name>
</Fiche>
That code works perfectly if I do not use the line <xsp:attribute name="id"><esql:get-string column="idTopic"/></xsp:attribute>
With this instruction, I have many different errors depending on the place I put this sentence...
Could you help me? Alain
======================================
Alain Herbuel
SNCF (French national Railway company) :
[EMAIL PROTECTED]
KD Consult (independent consultant) :
[EMAIL PROTECTED]
http://kdconsult.free.fr
======================================
