From: "Derek Hohls" <[EMAIL PROTECTED]>
Date: Sun, 21 May 2006 10:55:33 +0200

I am running Cocoon 2.1.5 and JDK 1.5.

I have a SQL Transformer that seems to be working just fine;
however, when I pass the results through the Filter Transformer
I seem to get garbage out:
...
At "debug1" stage I have:

<page xmlns:sq2="http://apache.org/cocoon/SQL/2.0"; xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";> <rowset xmlns="http://apache.org/cocoon/SQL/2.0"; nrofrows="3" name="projectlist">
 <row>
  <projno>1</projno>
  <title>Joint study</title>
  <startdate>2001-04-01</startdate>
  <enddate>2004-06-30</enddate>
        <rowset nrofrows="3" name="clientlist">
        <row>
        <client>Company A</client>
        </row>
        <row>
        <client>Company B</client>
        </row>
        <row>
        <client>Company C</client>
        </row>
        </rowset>
 </row>
 <row>
  <projno>2</projno>
  <title>TESTing</title>
  <startdate>2004-09-17</startdate>
  <enddate>2007-05-19</enddate>
  <rowset nrofrows="0" name="clientlist" />
 </row>
 <row>
  <projno>3</projno>
  <title>DUMMY</title>
  <startdate>2006-05-20</startdate>
  <enddate>2006-05-20</enddate>
  <rowset nrofrows="0" name="clientlist" />
 </row>
 </rowset>
</page>

which is what is expected from the database.

Hmm... nested rowsets. Presumably using nested queries and the sql:ancestor value tag? Perfectly okay in itself, but I suspect that's what confusing the filter transformer; it probably can't tell the two types of row apart, and since it's just looking for the specified element name "row" my guess is it'll start recording when it reaches the start of an outer row but end recording when it sees the end of the first inner row. After that it just copies elements until it hits another opening row tag, which I think would produce something like you're getting when it reaches the end of the outer row.

Any ideas as to how to make this work properly?

Add an extra XSL transformer between the SQL & filter transformers, to change the rowset/row elements into different elements (e.g. projects/project & clients/client) for the inner and outer rows. That way the filter transformer won't get the two confused.


Andrew.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to