You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Abbas Mousavi <ab...@yahoo.com> on 2006/05/24 15:10:43 UTC

encoding problem with eXist database

Hi 

I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.

I use 

 resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');

 if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        }

It writes the document to the database but with wrong encoding.
is there any way for fixing this problem?


		
---------------------------------
Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

Re: AW: AW: AW: encoding problem with eXist database

Posted by Abbas Mousavi <ab...@yahoo.com>.
and another point that I forgot:

recently I have checked the cocoon.xconf bundeled with eXist distribution
it uses  org.apache.cocoon.components.source.impl.XMLDBSourceFactory
just like the default cocoon.xconf which has the encoding problem.
I wonder why the people at eXist project implemented the 
org.exist.cocoon.XMLDBSourceFactory class but dont use it?
Abbas



Christofer Dutz <du...@c-ware.de> wrote:         v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}       st1\:*{behavior:url(#default#ieooui) }           Ok … I have to admit I haven’t used Modifyable Souces yet. I am used to XQuery with update extensions and XML-DB api. I would check if it is possible to set the encoding for the XML-Serializer. Since it is what generates the output.
   
  Chris
   
   
        
---------------------------------
  
  Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 18:04
 An: users@cocoon.apache.org
 Betreff: Re: AW: AW: encoding problem with eXist database
  
   
  Hi
 
 I dont know how to use String.getBytes(encoding) or XMLResourc.setContent(xml-string) , I explain my whole word:
 
 I have this in the sitemap
 
 <map:match pattern="*/*.xml">
                 <map:generate type="html" src="{1}/{2}.html"/>
                 <map:transform src="../style/math/article-to-page.xsl"/>
                 <map:serialize type="xml"/>
             </map:match>
 that reads a html file from the disk and generates an xml
 
 and I have this function in my flowscript. I call it when I want to 
 write to a source.
 
 function write(){
 var home = cocoon.parameters.home;
 var name = cocoon.parameters.name;
 //writeDoc('webdav://admin@localhost:8080/exist-webdav/db/'+home+'/'+name+'.xml',name+'.xml');
 writeDoc('xmldb:exist:///db/'+home+'/'+name+'.xml',name+'.xml');
 writeDoc(name+'.htm',name+'.htm');
 cocoon.redirectTo("");
 }
 
 function writeDoc(doc, pipeline) {
     var resolver = null;
     var source = null;
     var output = null;
     
     try {
         resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
         source = resolver.resolveURI(doc);
 
 
         if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
             output = source.getOutputStream();
             cocoon.processPipelineTo(pipeline, {}, output);
             output.close();
         } else {
             cocoon.log.error("Cannot write to " + doc + ": not a modifiable source");
         }
     } catch (error) {
         cocoon.log.error("Error getting output stream: " + error);
     } finally {
         if (source != null) resolver.release(source);
         cocoon.releaseComponent(resolver);
         if (output != null) {
             try {
                 output.close();
             } catch (error) {
                 cocoon.log.error("Error closing output stream: " + error);
             }
         }
     }
 }
 
 as I said the first and second writeDoc() work but write wrong encoding
 and the next writeDoc() works correct.
 
 
 and another thing:
 
 org.exist.cocoon.XMLDBSource has a setEncoding() method that sets the default encoding of outputstream
  
but the cocoon source resolver returns  
 org.apache.cocoon.components.source.impl.XMLDBSource
 which has not such method. Is there any way to use org.exist.cocoon.XMLDBSource
 instead of 
 org.apache.cocoon.components.source.impl.XMLDBSource ?
 thanks.
 Abbas
  
 
 
 
 Christofer Dutz <du...@c-ware.de> wrote:
    How exactly do you stroe your data? Do you use XMLResourc.setContent(xml-string)? You could try explicitly seting the input-Strings encoding using the String.getBytes(encoding) method. 
  
     
  
    If this doesn’t help. I’d try the exist mailinglist, the guys there should be able to help you solve your problems.
  
     
  
    Chris
  
     
  
    [ c h r i s t o f e r   d u t z ]
 
 IT-Berater
 univativ GmbH & Co. KG
 Robert-Bosch-Str. 7, 64293 Darmstadt
 
 fon:  0 61 51 / 66 717 -0
 fax:  0 61 51 / 66 717 -29
 email:  christofer.dutz@univativ.de
 http://www.univativ.de
 
 Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
  
     
  
     
  
      
---------------------------------
  
    Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 16:59
 An: users@cocoon.apache.org
 Betreff: Re: AW: encoding problem with eXist database
  
  
     
  
    Hi chris
 
 I have set container-encoding and form encoding and serializer encoding to utf-8.
 
 also I can write the same pipeline to other sources (for example to hard disk)
 truly by the same mechanism.
 
 I think this problem has some thing related to eXist because I have tested the webdav interface to eXist and it was the same as xmldb: protocol: wrong encoding.
 
 Christofer Dutz <du...@c-ware.de> wrote:
  
      Hi Abbas,
  
  
       
  
  
      I think you should check the settings in your web.xml (container-encoding and form-encoding) and the serializer settings in the sitemap.xmap. I think I remember having some encoding-problems with CForms. I guess cocoon will provide content encoded in the format set here. And since you are using cocoon to generate the document stored in the db, I’d give it a try. 
  
  
       
  
  
      Chris
  
  
       
  
  
      [ c h r i s t o f e r   d u t z ]
 
 IT-Berater
 univativ GmbH & Co. KG
 Robert-Bosch-Str. 7, 64293 Darmstadt
 
 fon:  0 61 51 / 66 717 -0
 fax:  0 61 51 / 66 717 -29
 email:  christofer.dutz@univativ.de
 http://www.univativ.de
 
 Darmstadt, Stuttgart, Karlsruhe, D�sseldorf
  
  
         
  
  
       
  
  
      
---------------------------------
  
      Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 15:11
 An: users@cocoon.apache.org
 Betreff: encoding problem with eXist database
  
  
  
         
  
  
      Hi 
 
 I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
 by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.
 
 I use 
 
  resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
         source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');
 
  if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
             output = source.getOutputStream();
             cocoon.processPipelineTo(pipeline, {}, output);
             output.close();
         }
 
 It writes the document to the database but with wrong encoding.
 is there any way for fixing this problem?
  
  
    
---------------------------------
  
      Blab-away for as little as 1�/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
  
  
     
  
    __________________________________________________
 Do You Yahoo!?
 Tired of spam? Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
  
   
    
---------------------------------
  
  How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
  
  
  

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

AW: AW: AW: encoding problem with eXist database

Posted by Christofer Dutz <du...@c-ware.de>.
Ok … I have to admit I haven’t used Modifyable Souces yet. I am used to XQuery with update extensions and XML-DB api. I would check if it is possible to set the encoding for the XML-Serializer. Since it is what generates the output.

 

Chris

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 18:04
An: users@cocoon.apache.org
Betreff: Re: AW: AW: encoding problem with eXist database

 

Hi

I dont know how to use String.getBytes(encoding) or XMLResourc.setContent(xml-string) , I explain my whole word:

I have this in the sitemap

<map:match pattern="*/*.xml">
                <map:generate type="html" src="{1}/{2}.html"/>
                <map:transform src="../style/math/article-to-page.xsl"/>
                <map:serialize type="xml"/>
            </map:match>
that reads a html file from the disk and generates an xml

and I have this function in my flowscript. I call it when I want to 
write to a source.

function write(){
var home = cocoon.parameters.home;
var name = cocoon.parameters.name;
//writeDoc('webdav://admin@localhost:8080/exist-webdav/db/'+home+'/'+name+'.xml',name+'.xml');
writeDoc('xmldb:exist:///db/'+home+'/'+name+'.xml',name+'.xml');
writeDoc(name+'.htm',name+'.htm');
cocoon.redirectTo("");
}

function writeDoc(doc, pipeline) {
    var resolver = null;
    var source = null;
    var output = null;
    
    try {
        resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        source = resolver.resolveURI(doc);


        if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        } else {
            cocoon.log.error("Cannot write to " + doc + ": not a modifiable source");
        }
    } catch (error) {
        cocoon.log.error("Error getting output stream: " + error);
    } finally {
        if (source != null) resolver.release(source);
        cocoon.releaseComponent(resolver);
        if (output != null) {
            try {
                output.close();
            } catch (error) {
                cocoon.log.error("Error closing output stream: " + error);
            }
        }
    }
}

as I said the first and second writeDoc() work but write wrong encoding
and the next writeDoc() works correct.


and another thing:

org.exist.cocoon.XMLDBSource has a setEncoding() method that sets the default encoding of outputstream

but the cocoon source resolver returns  


org.apache.cocoon.components.source.impl.XMLDBSource


which has not such method. Is there any way to use org.exist.cocoon.XMLDBSource


instead of 


org.apache.cocoon.components.source.impl.XMLDBSource ?


thanks.


Abbas





Christofer Dutz <du...@c-ware.de> wrote:

How exactly do you stroe your data? Do you use XMLResourc.setContent(xml-string)? You could try explicitly seting the input-Strings encoding using the String.getBytes(encoding) method. 

 

If this doesn’t help. I’d try the exist mailinglist, the guys there should be able to help you solve your problems.

 

Chris

 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon:  0 61 51 / 66 717 -0
fax:  0 61 51 / 66 717 -29
email:  christofer.dutz@univativ.de
 <http://www.univativ.de/> http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 16:59
An: users@cocoon.apache.org
Betreff: Re: AW: encoding problem with eXist database

 

Hi chris

I have set container-encoding and form encoding and serializer encoding to utf-8.

also I can write the same pipeline to other sources (for example to hard disk)
truly by the same mechanism.

I think this problem has some thing related to eXist because I have tested the webdav interface to eXist and it was the same as xmldb: protocol: wrong encoding.

Christofer Dutz <du...@c-ware.de> wrote:

Hi Abbas,

 

I think you should check the settings in your web.xml (container-encoding and form-encoding) and the serializer settings in the sitemap.xmap. I think I remember having some encoding-problems with CForms. I guess cocoon will provide content encoded in the format set here. And since you are using cocoon to generate the document stored in the db, I’d give it a try. 

 

Chris

 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon:  0 61 51 / 66 717 -0
fax:  0 61 51 / 66 717 -29
email:  christofer.dutz@univativ.de
 <http://www.univativ.de/> http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, D�sseldorf

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 15:11
An: users@cocoon.apache.org
Betreff: encoding problem with eXist database

 

Hi 

I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.

I use 

 resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');

 if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        }

It writes the document to the database but with wrong encoding.
is there any way for fixing this problem?

  _____  

Blab-away for as little as 1�/min. Make PC-to-Phone <http://us.rd.yahoo.com/mail_us/taglines/postman2/*http:/us.rd.yahoo.com/evt=39663/*http:/voice.yahoo.com>  Calls using Yahoo! Messenger with Voice.

 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

 

  _____  

How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http:/us.rd.yahoo.com/evt=39663/*http:/voice.yahoo.com>  call rates.


Re: AW: AW: encoding problem with eXist database

Posted by Abbas Mousavi <ab...@yahoo.com>.
Hi

I dont know how to use String.getBytes(encoding) or XMLResourc.setContent(xml-string) , I explain my whole word:

I have this in the sitemap

<map:match pattern="*/*.xml">
                <map:generate type="html" src="{1}/{2}.html"/>
                <map:transform src="../style/math/article-to-page.xsl"/>
                <map:serialize type="xml"/>
            </map:match>
that reads a html file from the disk and generates an xml

and I have this function in my flowscript. I call it when I want to 
write to a source.

function write(){
var home = cocoon.parameters.home;
var name = cocoon.parameters.name;
//writeDoc('webdav://admin@localhost:8080/exist-webdav/db/'+home+'/'+name+'.xml',name+'.xml');
writeDoc('xmldb:exist:///db/'+home+'/'+name+'.xml',name+'.xml');
writeDoc(name+'.htm',name+'.htm');
cocoon.redirectTo("");
}

function writeDoc(doc, pipeline) {
    var resolver = null;
    var source = null;
    var output = null;
    
    try {
        resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        source = resolver.resolveURI(doc);


        if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        } else {
            cocoon.log.error("Cannot write to " + doc + ": not a modifiable source");
        }
    } catch (error) {
        cocoon.log.error("Error getting output stream: " + error);
    } finally {
        if (source != null) resolver.release(source);
        cocoon.releaseComponent(resolver);
        if (output != null) {
            try {
                output.close();
            } catch (error) {
                cocoon.log.error("Error closing output stream: " + error);
            }
        }
    }
}

as I said the first and second writeDoc() work but write wrong encoding
and the next writeDoc() works correct.


and another thing:

org.exist.cocoon.XMLDBSource has a setEncoding() method that sets the default encoding of outputstream

but the cocoon source resolver returns  
org.apache.cocoon.components.source.impl.XMLDBSource
which has not such method. Is there any way to use org.exist.cocoon.XMLDBSource
instead of 
org.apache.cocoon.components.source.impl.XMLDBSource ?
thanks.
Abbas






Christofer Dutz <du...@c-ware.de> wrote:         v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}       st1\:*{behavior:url(#default#ieooui) }           How exactly do you stroe your data? Do you use XMLResourc.setContent(xml-string)? You could try explicitly seting the input-Strings encoding using the String.getBytes(encoding) method. 
   
  If this doesn’t help. I’d try the exist mailinglist, the guys there should be able to help you solve your problems.
   
  Chris
   
  [ c h r i s t o f e r   d u t z ]
 
 IT-Berater
 univativ GmbH & Co. KG
 Robert-Bosch-Str. 7, 64293 Darmstadt
 
 fon:  0 61 51 / 66 717 -0
 fax:  0 61 51 / 66 717 -29
 email:  christofer.dutz@univativ.de
 http://www.univativ.de
 
 Darmstadt, Stuttgart, Karlsruhe, Düsseldorf
   
   
      
---------------------------------
  
  Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 16:59
 An: users@cocoon.apache.org
 Betreff: Re: AW: encoding problem with eXist database
  
   
  Hi chris
 
 I have set container-encoding and form encoding and serializer encoding to utf-8.
 
 also I can write the same pipeline to other sources (for example to hard disk)
 truly by the same mechanism.
 
 I think this problem has some thing related to eXist because I have tested the webdav interface to eXist and it was the same as xmldb: protocol: wrong encoding.
 
 Christofer Dutz <du...@c-ware.de> wrote:
    Hi Abbas,
  
     
  
    I think you should check the settings in your web.xml (container-encoding and form-encoding) and the serializer settings in the sitemap.xmap. I think I remember having some encoding-problems with CForms. I guess cocoon will provide content encoded in the format set here. And since you are using cocoon to generate the document stored in the db, I’d give it a try. 
  
     
  
    Chris
  
     
  
    [ c h r i s t o f e r   d u t z ]
 
 IT-Berater
 univativ GmbH & Co. KG
 Robert-Bosch-Str. 7, 64293 Darmstadt
 
 fon:  0 61 51 / 66 717 -0
 fax:  0 61 51 / 66 717 -29
 email:  christofer.dutz@univativ.de
 http://www.univativ.de
 
 Darmstadt, Stuttgart, Karlsruhe, D�sseldorf
  
     
  
     
  
      
---------------------------------
  
    Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 15:11
 An: users@cocoon.apache.org
 Betreff: encoding problem with eXist database
  
  
     
  
    Hi 
 
 I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
 by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.
 
 I use 
 
  resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
         source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');
 
  if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
             output = source.getOutputStream();
             cocoon.processPipelineTo(pipeline, {}, output);
             output.close();
         }
 
 It writes the document to the database but with wrong encoding.
 is there any way for fixing this problem?
  
    
---------------------------------
  
    Blab-away for as little as 1�/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
  
   
  __________________________________________________
 Do You Yahoo!?
 Tired of spam? Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
  
  

		
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

AW: AW: encoding problem with eXist database

Posted by Christofer Dutz <du...@c-ware.de>.
How exactly do you stroe your data? Do you use XMLResourc.setContent(xml-string)? You could try explicitly seting the input-Strings encoding using the String.getBytes(encoding) method. 

 

If this doesn’t help. I’d try the exist mailinglist, the guys there should be able to help you solve your problems.

 

Chris

 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon:  0 61 51 / 66 717 -0
fax:  0 61 51 / 66 717 -29
email:  christofer.dutz@univativ.de
 <http://www.univativ.de/> http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 16:59
An: users@cocoon.apache.org
Betreff: Re: AW: encoding problem with eXist database

 

Hi chris

I have set container-encoding and form encoding and serializer encoding to utf-8.

also I can write the same pipeline to other sources (for example to hard disk)
truly by the same mechanism.

I think this problem has some thing related to eXist because I have tested the webdav interface to eXist and it was the same as xmldb: protocol: wrong encoding.

Christofer Dutz <du...@c-ware.de> wrote:

Hi Abbas,

 

I think you should check the settings in your web.xml (container-encoding and form-encoding) and the serializer settings in the sitemap.xmap. I think I remember having some encoding-problems with CForms. I guess cocoon will provide content encoded in the format set here. And since you are using cocoon to generate the document stored in the db, I’d give it a try. 

 

Chris

 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon:  0 61 51 / 66 717 -0
fax:  0 61 51 / 66 717 -29
email:  christofer.dutz@univativ.de
 <http://www.univativ.de/> http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, D�sseldorf

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 15:11
An: users@cocoon.apache.org
Betreff: encoding problem with eXist database

 

Hi 

I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.

I use 

 resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
        source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');

 if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        }

It writes the document to the database but with wrong encoding.
is there any way for fixing this problem?

  _____  

Blab-away for as little as 1�/min. Make PC-to-Phone <http://us.rd.yahoo.com/mail_us/taglines/postman2/*http:/us.rd.yahoo.com/evt=39663/*http:/voice.yahoo.com>  Calls using Yahoo! Messenger with Voice.

 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: AW: encoding problem with eXist database

Posted by Abbas Mousavi <ab...@yahoo.com>.
Hi chris

I have set container-encoding and form encoding and serializer encoding to utf-8.

also I can write the same pipeline to other sources (for example to hard disk)
truly by the same mechanism.

I think this problem has some thing related to eXist because I have tested the webdav interface to eXist and it was the same as xmldb: protocol: wrong encoding.

Christofer Dutz <du...@c-ware.de> wrote:        v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}       st1\:*{behavior:url(#default#ieooui) }           Hi Abbas,
   
  I think you should check the settings in your web.xml (container-encoding and form-encoding) and the serializer settings in the sitemap.xmap. I think I remember having some encoding-problems with CForms. I guess cocoon will provide content encoded in the format set here. And since you are using cocoon to generate the document stored in the db, I’d give it a try. 
   
  Chris
   
  [ c h r i s t o f e r   d u t z ]
 
 IT-Berater
 univativ GmbH & Co. KG
 Robert-Bosch-Str. 7, 64293 Darmstadt
 
 fon:  0 61 51 / 66 717 -0
 fax:  0 61 51 / 66 717 -29
 email:  christofer.dutz@univativ.de
 http://www.univativ.de
 
 Darmstadt, Stuttgart, Karlsruhe, D�sseldorf
   
   
      
---------------------------------
  
  Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
 Gesendet: Mittwoch, 24. Mai 2006 15:11
 An: users@cocoon.apache.org
 Betreff: encoding problem with eXist database
  
   
  Hi 
 
 I am using eXist with cocoon as my xml database. I can copy xml documents to eXist by a webdav client and exist admin client, and also can retrieve them correctly
 by xmldb:exist://  protocol, but when I want to write documents to exist with flowscript it does not writes the unicode documents correctly.
 
 I use 
 
  resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
         source = resolver.resolveURI('xmldb:exist:///db/collection/document.xml');
 
  if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) {
             output = source.getOutputStream();
             cocoon.processPipelineTo(pipeline, {}, output);
             output.close();
         }
 
 It writes the document to the database but with wrong encoding.
 is there any way for fixing this problem?
    
---------------------------------
  
  Blab-away for as little as 1�/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
  
  

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

AW: encoding problem with eXist database

Posted by Christofer Dutz <du...@c-ware.de>.
Hi Abbas,

 

I think you should check the settings in your web.xml (container-encoding
and form-encoding) and the serializer settings in the sitemap.xmap. I think
I remember having some encoding-problems with CForms. I guess cocoon will
provide content encoded in the format set here. And since you are using
cocoon to generate the document stored in the db, I’d give it a try. 

 

Chris

 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon:  0 61 51 / 66 717 -0
fax:  0 61 51 / 66 717 -29
email:  christofer.dutz@univativ.de
 <http://www.univativ.de/> http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

 

 

  _____  

Von: Abbas Mousavi [mailto:abbasmousavi@yahoo.com] 
Gesendet: Mittwoch, 24. Mai 2006 15:11
An: users@cocoon.apache.org
Betreff: encoding problem with eXist database

 

Hi 

I am using eXist with cocoon as my xml database. I can copy xml documents to
eXist by a webdav client and exist admin client, and also can retrieve them
correctly
by xmldb:exist://  protocol, but when I want to write documents to exist
with flowscript it does not writes the unicode documents correctly.

I use 

 resolver =
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
);
        source =
resolver.resolveURI('xmldb:exist:///db/collection/document.xml');

 if (source instanceof
Packages.org.apache.excalibur.source.ModifiableSource) {
            output = source.getOutputStream();
            cocoon.processPipelineTo(pipeline, {}, output);
            output.close();
        }

It writes the document to the database but with wrong encoding.
is there any way for fixing this problem?

  _____  

Blab-away for as little as 1¢/min. Make PC-to-Phone
<http://us.rd.yahoo.com/mail_us/taglines/postman2/*http:/us.rd.yahoo.com/evt
=39663/*http:/voice.yahoo.com>  Calls using Yahoo! Messenger with Voice.