Re: esql and UnsupportedEncodingException - patch proposal

2001-08-09 Thread Enke Michael

Arnaud Bienvenu wrote:
> 
> Oops, I found Michael's patch has a drawback : if you apply it and then you
> do not use the encoding attribute (i.e. ), then you have
> an error :
> Exception java.io.UnsupportedEncodingException is never thrown in the body
> of the corresponding try statement.
> 
> So finally the solution I posted at the beginning of this thread may be
> better.
> 
> -
> 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]>


Yes, thats right, shame on me.
But the solution: Don't catch UnsupportedEncodingException but only
Exception.
Than it is working. Here ones more the patch:

Index:
./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
===
RCS file:
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.16
diff -u -r1.16 esql.xsl
---
./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl   
2001/08/06 15:38:57 1.16
+++
./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl   
2001/08/09 15:26:48
@@ -636,6 +636,8 @@
   
 
   } catch (Exception _esql_exception__2) {}
+} catch(Exception e) {
+  throw new RuntimeException(e.toString());
 }
 if (_esql_queries.empty()) {
   _esql_query = null;

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




Re: esql and UnsupportedEncodingException - patch proposal

2001-08-09 Thread Arnaud Bienvenu

Oops, I found Michael's patch has a drawback : if you apply it and then you
do not use the encoding attribute (i.e. ), then you have
an error :
Exception java.io.UnsupportedEncodingException is never thrown in the body
of the corresponding try statement.

So finally the solution I posted at the beginning of this thread may be
better.

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




Re: esql and UnsupportedEncodingException - patch proposal

2001-08-09 Thread Arnaud Bienvenu

I applied your patch instead of mine; it is smarter and does the job. Would
some Cocoon Guru apply it to CVS ? What is the procedure to ask for it ?
Don't you like it ?

Here is Michael's patch again (using cocoon's coding style) :

Index: ./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
===
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.16
diff -u -r1.16 esql.xsl
--- ./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
2001/08/06 15:38:57 1.16
+++ ./src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
+2001/08/09 15:26:48
@@ -636,6 +636,8 @@
   
 
   } catch (Exception _esql_exception__2) {}
+} catch(java.io.UnsupportedEncodingException e) {
+  throw new RuntimeException(e.toString());
 }
 if (_esql_queries.empty()) {
   _esql_query = null;


-- 
Arnaud Bienvenu
http://www.generasound.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]>




Re: esql and UnsupportedEncodingException - patch proposal

2001-08-09 Thread Enke Michael

Hi,
on tuesday I posted this patch to cocoon-dev,
seems to be equivalent with yours:


Hi,
I'd like to use 
but for the encoding we have to catch
java.io.UnsupportedEncodingException
These exception is not catched yet.
Because I have no access to cvs I post the patch as
diff -u esql.xsl.orig esql.xsl

Regards,
Michael




--- esql.xsl.orig   Tue Aug  7 16:25:16 2001
+++ esql.xslTue Aug  7 16:23:13 2001
@@ -637,6 +637,9 @@
 
   } catch (Exception _esql_exception__2) {}
 }
+catch(java.io.UnsupportedEncodingException e) {
+  throw new RuntimeException(e.toString());
+}
 if (_esql_queries.empty()) {
   _esql_query = null;
 } else {


Arnaud Bienvenu wrote:
> 
> With latest CVS Cocoon2, if you specify the encoding attribute within
>  or  tags, you have to enclose your tags
> inside a try/catch structure because they may throw
> java.io.UnsupportedEncodingException.
> 
> At the end of this mail you will find a patch to workaround this problem. I
> don't know if it's a good or clean job, but it's very useful for me, so I
> post it to you.
> 
> For example, the tedious
> 
>   try {
> 
>   } catch (java.io.UnsupportedEncodingException e) {
> System.out.prinln("Grumpf");
>   }
> 
> 
> Becomes merely
> 
> 
> Info : you need to set the encoding so that special characters will be
> correctly fetched (i.e. accentuated letters in latin languages)
> 
> Index: src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
> ===
> RCS file: 
>/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
> retrieving revision 1.5
> diff -u -r1.5 xsp.xsl
> --- src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl   2001/07/23 
>23:33:45 1.5
> +++ src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl   2001/08/08 
>14:37:14
> @@ -37,6 +37,7 @@
> 
>  import java.io.File;
>  import java.io.StringReader;
> +import java.io.UnsupportedEncodingException;
>  //import java.net.*;
>  import java.util.Date;
>  import java.util.List;
> @@ -98,7 +99,7 @@
>  /**
>  * Generate XML data.
>  */
> -  public void generate() throws SAXException {
> +  public void generate() throws SAXException, UnsupportedEncodingException {
>  this.contentHandler.startDocument();
>  AttributesImpl xspAttr = new AttributesImpl();
> 
> --
> Arnaud Bienvenu
> http://www.generasound.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]>




esql and UnsupportedEncodingException - patch proposal

2001-08-08 Thread Arnaud Bienvenu

With latest CVS Cocoon2, if you specify the encoding attribute within
 or  tags, you have to enclose your tags
inside a try/catch structure because they may throw
java.io.UnsupportedEncodingException.

At the end of this mail you will find a patch to workaround this problem. I
don't know if it's a good or clean job, but it's very useful for me, so I
post it to you.

For example, the tedious

  try {

  } catch (java.io.UnsupportedEncodingException e) {
System.out.prinln("Grumpf");
  }


Becomes merely


Info : you need to set the encoding so that special characters will be
correctly fetched (i.e. accentuated letters in latin languages)

Index: src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
===
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
retrieving revision 1.5
diff -u -r1.5 xsp.xsl
--- src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl   2001/07/23 
23:33:45 1.5
+++ src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl   2001/08/08 
+14:37:14
@@ -37,6 +37,7 @@
 
 import java.io.File;
 import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
 //import java.net.*;
 import java.util.Date;
 import java.util.List;
@@ -98,7 +99,7 @@
 /**
 * Generate XML data.
 */
-  public void generate() throws SAXException {
+  public void generate() throws SAXException, UnsupportedEncodingException {
 this.contentHandler.startDocument();
 AttributesImpl xspAttr = new AttributesImpl();


-- 
Arnaud Bienvenu
http://www.generasound.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]>