AW: Can I save the result to a xml file?

2005-06-04 Thread Claus Straube
Hi Jarry, the simplest possibility is to use the source writing transformer (http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transforme r.html). You just have to modify your XQuery statement, to get the xml which would be expected by the transformer (or you can leave your query as

AW: Can I save the result to a xml file?

2005-06-04 Thread Claus Straube
Hi Jarry, the simplest possibility is to use the source writing transformer (http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transforme r.html). You just have to modify your XQuery statement, to get the xml which would be expected by the transformer (or you can leave your query as

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Jorg Heymans
Sebastien Arbogast wrote: > Hi, > > I'm looking for a simple way to inject the string content of a > flowscript variable into a pipeline for serialization and sending. Of > course I could do a sendPage() but that would force me to : > 1 - create a dummy JXTemplate to inject the value of my flow va

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Sebastien Arbogast
> I would put the string in the request scope, then sendPage() to a > pipeline where a custom generator picks it up and feeds it to the SAX > pipeline. > > How does that sound? It depends on what you mean by "put the string in the request scope". I don't really understand how to translate that in

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Jorg Heymans
Sebastien Arbogast wrote: > > It depends on what you mean by "put the string in the request scope". > I don't really understand how to translate that in code. Could you > explain ? 1) Flow // mystring contains your xml cocoon.request.setAttribute("myxml", mystring); // now forward to pipeline c

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Zbigniew Bomert OP
Why not simply: 1. flow cocoon.sendPage("mypipeline", {"myxml": mystring}) 2. jxtemplate ${myxml} 3. sitemap Or more general: cocoon.request.setAttribute("myxml", mystring); cocoon.sendPage("mypipeline"); template: ${cocoon.request.getAttribute(cocoon.parameters.myxml)} sitemap:

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Jorg Heymans
Zbigniew Bomert OP wrote: > > ${myxml} > Are you sure this works when myxml contains xml tags ? Surely the downstream parser chokes on it as you're effectively writing tags in a text node ? Jorg - To unsubscribe, e-mail: [

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Zbigniew Bomert OP
Well, I don't know java actually. I use such template with following flowscript (the function I found somewhere on the list): myxml = getPipeline("mypipeline"); function getPipeline(uri, viewData) { var pipelineUtil = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.Pipeli

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Jorg Heymans
Zbigniew Bomert OP wrote: > function getPipeline(uri, viewData) { > var pipelineUtil = > cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil); > var result = pipelineUtil.processToDOM(uri, viewData); > cocoon.disposeObject(pipelineUtil); > return r

Re: Injecting a String XML document into a pipeline

2005-06-04 Thread Sebastien Arbogast
Well. I found a solution. At first I had tried the JXTemplate solution similar to what Zbigniew proposed. But effectively it didn't work because all my "<" were transformed into "<" etc. Finally I understood the role of a function proposed by joose in the context of Jan's approach for a web service