esql get-colums NullPointerException

2001-08-06 Thread Arnaud Bienvenu

When you use esql:get-columns and one of your column has a NULL value,
you find yourself with a disgracefull NullPointerException. Here is a patch
for Cocoon2 to have an empty tag instead :

Index: esql.xsl
===
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.15
diff -u -r1.15 esql.xsl
--- esql.xsl2001/07/30 09:20:20 1.15
+++ esql.xsl2001/08/06 15:14:11
@@ -1079,8 +1079,10 @@
   xsl:value-of select=$resultset/.getString(xsl:value-of 
select=$column-spec/)
 /xsl:when
 xsl:otherwise
-  new String (xsl:value-of select=$resultset/.getBytes
+  xsl:value-of select=$resultset/.getBytes(xsl:value-of 
+select=$column-spec/)
+  != null ? new String (xsl:value-of select=$resultset/.getBytes
 (xsl:value-of select=$column-spec/), xsl:value-of select=$encoding/)
+  : 
 /xsl:otherwise
   /xsl:choose
 /xsl:template

This solution is inspired from the patch posted by Matthew Cordes on
2001-02-22 about the same problem but applying to Cocoon1.

Comments are very welcome.

Arnaud Bienvenu
http://www.generasound.com/

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




Re: esql get-colums NullPointerException

2001-08-06 Thread Christian Haul

On 06.Aug.2001 -- 05:24 PM, Arnaud Bienvenu wrote:
 When you use esql:get-columns and one of your column has a NULL value,
 you find yourself with a disgracefull NullPointerException. Here is a patch
 for Cocoon2 to have an empty tag instead :

Applied. Please check.

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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