cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject RE: Filter Transformer generating non-XML
Date Mon, 22 May 2006 06:31:38 GMT
Thanks, Andrew, that explanation makes perfect sense!
I think it will be simpler to move to the use of the LIMIT
statement in the SQL, which will allow for a more generic
approach in all my other use cases, rather than having to
write yet another set of transforms for each....

>>> 2006/05/21 11:15:16 AM >>>
>From: "Derek Hohls" < >
>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="" 
> <rowset xmlns="" nrofrows="3" 
> <row>
> <projno>1</projno>
> <title>Joint study</title>
> <startdate>2001-04-01</startdate>
> <enddate>2004-06-30</enddate>
><rowset nrofrows="3" name="clientlist">
><client>Company A</client>
><client>Company B</client>
><client>Company C</client>
> </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>
>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 

>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.


To unsubscribe, e-mail: 
For additional commands, e-mail: 

This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice 
CSIR Copyright, Terms and Conditions 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message