cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Help using xmodule
Date Fri, 29 Jun 2007 09:16:57 GMT
I do not know about xmodule, but perhaps in flowscript

cocoon.processPipelineTo

can help you out

Regards Ard 

> 
> In my application, I need to send a large xml DOM thing back
> to the pipeline from flowscript. To simplify the question, I
> created a short but tested example:
> 
> In flowscript, I create a doc from a string and try to send it back:
> 
>  var str = "<test>This is a test</test>" ;
>  var parser = 
> cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMP
> arser.ROLE);
>  var reader = new Packages.java.io.StringReader(str) ;
>  var source = new Packages.org.xml.sax.InputSource(reader) ;
>  var doc = parser.parseDocument(source);
>  cocoon.releaseComponent(parser);
>  cocoon.sendPage("makedomReply", {message: doc}) ;
> 
> In the sitemap:
> 
>  <map:match pattern="makedomReply">
>          <map:generate src="xmodule:flow-attr:message"/>
>          <map:serialize type="xml"/>
>  </map:match>
> 
> Browser error:
> 
>  org.xml.sax.SAXException: The object type: class java.lang.String
>  could not be serialized to XML: This is a test
> 
> From the stacktrace and source code, it is clear that 
> XModuleSource.toSAX
> got a java String instead of the Document I tried to send.
> 
> Using module with a plain javascript string works without an error:
> 
>  doc = "<test>This is a test</test>" ;
>  cocoon.sendPage("downloadReply", {message: doc}) ;
> 
>  <map:match pattern="downloadReply">
>          <map:generate src="module:flow-attr:message"/>
>          <map:serialize type="xml"/>
>  </map:match>
> 
> I guess I'm confused about what xmodule is supposed to deal
> with. Or perhaps I'm not making the dom object correctly.
> 
> Thanks to all and greetings to the list,
> 
> -Hugh Sparks
> 
> Version: Cocoon 2.1.11-dev svn export from 2007-06-11
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

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


Mime
View raw message