cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
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....

>>> ats37@hotmail.com 2006/05/21 11:15:16 AM >>>
>From: "Derek Hohls" < dhohls@csir.co.za >
>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: users-unsubscribe@cocoon.apache.org 
For additional commands, e-mail: users-help@cocoon.apache.org 




-- 
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
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
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
HelpDesk@csir.co.za.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message