You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Carlos Martínez <ca...@uib.es> on 2009/02/10 13:57:14 UTC

Error in flowscript with processPipelineTo

Hi,

I'm trying to use the function processPipelineTo in FlowScript. My 
flowscript code looks like this:
...
var xml                     = '<XML/>';
var StringBuffer1     = new Packages.java.lang.StringBuffer(xml);
var Bis1                 = new 
Packages.java.io.ByteArrayInputStream(StringBuffer1.toString().getBytes("UTF-8"));

var xmlFavoritsRes = new java.io.ByteArrayOutputStream();
   
cocoon.processPipelineTo("myurl.xml",  {"a": Bis1 } , xmlFavoritsRes);

In the sitemap:


<map:match pattern="myurl.xml">       
        <map:generate src="module:flow-attr:a"/>
         <map:transform src="something.xsl"/>   
         <map:serialize type="xml"/>
</map:match>

Then when i execute de flowscript code i have this error:

The attribute: a is empty

I don't know why is the attribute empty...

Thanks. Carlos.

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


Re: Error in flowscript with processPipelineTo

Posted by André Davignon <an...@free.fr>.
Hi,

Shouldn't it be :

cocoon.processPipelineTo("myurl.xml",  {a: Bis1 } , xmlFavoritsRes);

instead of

cocoon.processPipelineTo("myurl.xml",  {"a": Bis1 } , xmlFavoritsRes);

?

André


> Hi,
>
> I'm trying to use the function processPipelineTo in FlowScript. My 
> flowscript code looks like this:
> ...
> var xml                     = '<XML/>';
> var StringBuffer1     = new Packages.java.lang.StringBuffer(xml);
> var Bis1                 = new 
> Packages.java.io.ByteArrayInputStream(StringBuffer1.toString().getBytes("UTF-8")); 
>
>
> var xmlFavoritsRes = new java.io.ByteArrayOutputStream();
>   cocoon.processPipelineTo("myurl.xml",  {"a": Bis1 } , xmlFavoritsRes);
>
> In the sitemap:
>
>
> <map:match pattern="myurl.xml">              <map:generate 
> src="module:flow-attr:a"/>
>         <map:transform src="something.xsl"/>           <map:serialize 
> type="xml"/>
> </map:match>
>
> Then when i execute de flowscript code i have this error:
>
> The attribute: a is empty
>
> I don't know why is the attribute empty...
>
> Thanks. Carlos.
>
> ---------------------------------------------------------------------
> 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


Re: Error in flowscript with processPipelineTo

Posted by Luca Morandini <lm...@ieee.org>.
Carlos Martínez wrote:
> 
> var xmlFavoritsRes = new java.io.ByteArrayOutputStream();
>   cocoon.processPipelineTo("myurl.xml",  {"a": Bis1 } , xmlFavoritsRes);

It should be:
cocoon.processPipelineTo("myurl.xml",  {a: Bis1 } , xmlFavoritsRes);
(note the missing quotes around 'a').

Think of "{a: Bis1 }" as an object specification, i.e. a compact way of 
defining a list of object property-property value pairs, not as a mere 
mapping between property names and their values.


> The attribute: a is empty
> I don't know why is the attribute empty...

Because you did not set it ;)

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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