Re: [Cocoon2.0.2 and 2.0.4] ESQL bug, or XSLT transformer gone crazy?!

2002-12-29 Thread Antonio Gallardo
Hi!

I think your problem is right in this line:



Sometime ago I was trying to use the ancestor attribute with XSP, but this
does not work. :-(

As a workaround, create a  block that will take the value you
need for the WHERE of the nested query.

Surely you will solve your problem with the workaround. It works for me.

Best Regards,

Antonio Gallardo


Luis Gois dijo:
>
> Hello.
>
> I'm facing a situation where I've tried almost everything and don't
> understand why ESQL doesn't work for a particular situation :
>
>   a) I have 3 cascading queries, i.e., the 2nd query placed inside
> esql:row-results of 1st query and 3rd query inside esql:row-results of
> 2nd query;
>   b) for the 3rd query, something strange happens :
>   1) Cocoon 2.0.2 :
> Using esql:get-string (2nd line from bottom):
> ===
>
>   
>   
>   
>   select aqa.nu_qms_activity_area
> asnum_activity_area, aqa.name_qms_activity_area as name_activity_area
>   FROM opqa_metrics_tst omt, activities_qms_areas
> aqa
>   WHERE omt.nu_descr_metrics_tst= column="nu_descr_metricas_tst" ancestor="1"/>
>   AND
> omt.name_project_tst='currentProduct'
>   AND omt.name_release_project in
> releasesSet
>   AND
> TO_CHAR(omt.date_input,'dd-mm-')='currentDate'
>   AND aqa.nu_qms_activity_area =
> omt.nu_qms_activity_area
>   order by num_activity_area asc
>   
>   
>   
>   
>name="name">metricName
>   
>name="activity_area"> column="name_activity_area"/>
>   
>
>   (...)
>
>
>
> the generated java is:
> =
>
>   xspAttr.addAttribute(
>   "",
>   "activity_area",
> "activity_area",
> "CDATA",
> String.valueOf(.getBytes() != null ?
> EsqlHelper.getStringFromByteArray(.getBytes (), ) : "" )
>   );
>
>
> Findings :
> 
>
>   Looking at the esql.xsl, I see that the xsl:choose element at
> get-encoded-string template isn't properly processed when retrieving a
> value for the encoding variable, since even if I use  column="name_activity_area" encoding="default"/>, $encoding won't
> default to 'default'. If I copy that xsl:choose element outside the
> variable element do debugging purposes and watch at the generated java,
> I see that it correctly evaluates to a default value situation
> (xsl:otherwise). Again, specifying the encoding attribute in
> esql:get-string and then retrieving at the esql.xsl file the $encoding
> and  @encoding values, the first is '' and the second 'default'. How can
> this be possible?
>
>   Using esql:get-string in previous queries had a completely
> diferent JAVA code replacement, using getAscii() method for example. The
> call to esql:get-string has exactly the same attributes, the column
> types are exactly the same (though at XML->JAVA code transformation
> that's irrelevant).
>
>   Moving to Cocoon 2.0.4 didn't solve this problem. Now, the
> generated JAVA file has have something like
> EsqlHelper.getStringFromByteArray(default.getBytes()) -- notice at the
> default object. The error generated at compile time is related to
> getStringFromByteArray() method not found in EsqlHelper class. (I can
> give you more detailed error messages later, since those errors where
> generated yesterday night at work).
>
>   I thought that I was using a bad Xalan in my classpath or
> something similar but I've tried the code in 2 different platforms, an
> HP-UX and a Win2K machine and both generated the same java code and the
> same compilation errors.
>
>   This is really frustrating for me, a Cocoon1 "Vet" and for the
> persons who are now using Cocoon for the first time. I've developed some
> of applications in our project and never experienced this behaviour, but
> now, I'm lost!:( Help ...
>
>
> Regards,
> Luis Gois
>
>
>
> ___
> Vizzavi Mail powered by Vodafone - http://www.vizzavi.pt
> Virus protected by TrendMicro - http://www.antivirus.com
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>




-
Please check that your question  has not already been answered in the
FAQ before posting. 

[Cocoon2.0.2 and 2.0.4] ESQL bug, or XSLT transformer gone crazy?!

2002-12-29 Thread Luis Gois

Hello.

I'm facing a situation where I've tried almost everything and don't
understand why ESQL doesn't work for a particular situation :

a) I have 3 cascading queries, i.e., the 2nd query placed inside
esql:row-results of 1st query and 3rd query inside esql:row-results of
2nd query;
b) for the 3rd query, something strange happens :
1) Cocoon 2.0.2 :
Using esql:get-string (2nd line from bottom):
===

  


select aqa.nu_qms_activity_area
asnum_activity_area, aqa.name_qms_activity_area as name_activity_area
FROM opqa_metrics_tst omt, activities_qms_areas
aqa
WHERE omt.nu_descr_metrics_tst=
AND
omt.name_project_tst='currentProduct'
AND omt.name_release_project in
releasesSet
AND
TO_CHAR(omt.date_input,'dd-mm-')='currentDate'
AND aqa.nu_qms_activity_area =
omt.nu_qms_activity_area
order by num_activity_area asc




metricName




(...)



the generated java is:
=

xspAttr.addAttribute(
"",
"activity_area",
  "activity_area",
  "CDATA",
  String.valueOf(.getBytes() != null ?
EsqlHelper.getStringFromByteArray(.getBytes (), ) : "" )
);


Findings :


Looking at the esql.xsl, I see that the xsl:choose element at
get-encoded-string template isn't properly processed when retrieving a
value for the encoding variable, since even if I use , $encoding won't
default to 'default'. If I copy that xsl:choose element outside the
variable element do debugging purposes and watch at the generated java,
I see that it correctly evaluates to a default value situation
(xsl:otherwise). Again, specifying the encoding attribute in
esql:get-string and then retrieving at the esql.xsl file the $encoding
and  @encoding values, the first is '' and the second 'default'. How can
this be possible?

Using esql:get-string in previous queries had a completely
diferent JAVA code replacement, using getAscii() method for example. The
call to esql:get-string has exactly the same attributes, the column
types are exactly the same (though at XML->JAVA code transformation
that's irrelevant).

Moving to Cocoon 2.0.4 didn't solve this problem. Now, the
generated JAVA file has have something like
EsqlHelper.getStringFromByteArray(default.getBytes()) -- notice at the
default object. The error generated at compile time is related to
getStringFromByteArray() method not found in EsqlHelper class. (I can
give you more detailed error messages later, since those errors where
generated yesterday night at work). 

I thought that I was using a bad Xalan in my classpath or
something similar but I've tried the code in 2 different platforms, an
HP-UX and a Win2K machine and both generated the same java code and the
same compilation errors.

This is really frustrating for me, a Cocoon1 "Vet" and for the
persons who are now using Cocoon for the first time. I've developed some
of applications in our project and never experienced this behaviour, but
now, I'm lost!:( Help ... 


Regards,
Luis Gois



___
Vizzavi Mail powered by Vodafone - http://www.vizzavi.pt
Virus protected by TrendMicro - http://www.antivirus.com

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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