Re: How to return xml from a flowscript?

2006-01-06 Thread Jonas Lundberg
Right. It is not possible to pass the XML to an qxuery pipeline (starting with an xquery generator), then (unless it is passed as an escaped string). Thanks for the explanations. That leaves two options, since the xquery generator does not support the Cocoon protocol. a) store from flowscript. b)

Re: How to return xml from a flowscript?

2006-01-06 Thread Suzan Foster
I think you are missing the option of running the XQuery directly from the flowscript using your xml as context document. This is what we are doing with X-Hive's XQuery implementation. Jonas Lundberg wrote: Right. It is not possible to pass the XML to an qxuery pipeline (starting with an

Re: How to return xml from a flowscript?

2006-01-06 Thread Jean-Baptiste Quenot
* Jonas Lundberg: That might work, but it is not a good solution for me, although it might work in other cases. My xqueries are very complex. But this can't end here, can it? Is there really no way of returning XML in a parameter from a flowscript in Cocoon? Sitemap parameters are

Re: How to return xml from a flowscript?

2006-01-06 Thread Suzan Foster
The problem however with using variables is that eXist can only operate on it's own persistent DOM implementation within the query. You need to create a temporary document to pass to the XQuery. I hit this problem when writing an extension function for processing the request as XML (sent by an

Re: How to return xml from a flowscript?

2006-01-06 Thread Jonas Lundberg
That seems promising. However, the Module.NAMESPACE_URI, Module.PREFIX part gives me 4 compilation errors, starting with: [javac] E:\Program\eXist1203\src\com\nps\xquery\request\DocFunction.java:30: cannot find symbol [javac] symbol : variable Module I have not written any extension

RE: How to return xml from a flowscript?

2006-01-05 Thread Ard Schrijvers
Think you should take a look at the streamgenerator, that should do the job AS I am quite new to flowscript, so this is a basic quesiton... However, I have not been able to get any of the examples I found on Google to work. I have the following flowscript: function cleanWordHtml() {

Re: How to return xml from a flowscript?

2006-01-05 Thread Geert Josten
It reads a Cocoon pipeline, which converts a Word HTML file to XML. Then it sends this as a string in a parameter, to a pipeline that processes it further. Why not read WordML? :) What I *would like* to do, is to send XML in the parameter, instead of a string. Is this possible? Does anyone

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
Thanks for the replies. The problem is that I then have use the xml in a pipeline that starts with an xquery generator (this is the pipeline I call from the flowscript): map:generate src=xq/discuss.xq type=xquery map:parameter name=cleanedxml value={flow-attribute:cleanxml}/ Therefore,

Re: How to return xml from a flowscript?

2006-01-05 Thread Geert Josten
Thanks for the replies. The problem is that I then have use the xml in a pipeline that starts with an xquery generator (this is the pipeline I call from the flowscript): map:generate src=xq/discuss.xq type=xquery map:parameter name=cleanedxml value={flow-attribute:cleanxml}/ How is

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
The xquery stores the XML file in eXist. Thus, if I try to insert the xml file using an Xinclude in discuss.xq, and then use an xinclude transformer after generation, then it will be put there *after* the query is executed. Which is not useful in this case, since the XML is needed during

Re: How to return xml from a flowscript?

2006-01-05 Thread Geert Josten
No, this is not what I meant. You can replace: src=xq/discuss.xq by: src=cocoon:/insert-whtm-in-query/discuss.xq/path-to-whtm And create an new pipeline that includes the cleaned whtm into your xquery instruction. :-) Jonas Lundberg wrote: The xquery stores the XML file

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
That would work, if I could do it... But xqueries are not written in XML, so how can I then include the XML in a good place in my xquery? :-( Hans On 1/5/06, Geert Josten [EMAIL PROTECTED] wrote: No, this is not what I meant. You can replace: src=xq/discuss.xq by:

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
Yes, de-serializing with util:eval works in some cases. However, it does not work for documents that contain or in the text contents, because that will then be de-serialized as well. This will cause an error. For instance, the XHTML: p lt;!-- Add here other XML:DB compliant databases' drivers

Re: How to return xml from a flowscript?

2006-01-05 Thread Geert Josten
Err, perhaps switch to the XML syntax of the XQuery language? That should be available and I would be surprised if it is not supported. I believe there are converters that can translate one to the other.. Regards, Geert Jonas Lundberg wrote: That would work, if I could do it... But xqueries

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
That might work, but it is not a good solution for me, although it might work in other cases. My xqueries are very complex. But this can't end here, can it? Is there really no way of returning XML in a parameter from a flowscript in Cocoon? Regards, Hans On 1/5/06, Geert Josten [EMAIL

Re: How to return xml from a flowscript?

2006-01-05 Thread Zbigniew Bomert OP
Jonas Lundberg wrote: The xquery stores the XML file in eXist. (...) You can store xml in eXist from flowscript, without using xquery, as described in: http://wiki.apache.org/cocoon/CformsExistAndFlow Zbigniew Bomert - To

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
So, what you are saying now is that you cannot pass an xml document as a parameter in Cocoon, at all? If one can pass xml documents as parameters, then... How would I parse the output stream, and pass along the DOM object? Regards Hans On 1/5/06, Geert Josten [EMAIL PROTECTED] wrote: You can

Re: How to return xml from a flowscript?

2006-01-05 Thread Suzan Foster
Does the xquery do any processing on the xml, or does it just use eXist's update extensions to store it as-is? If you need to do the latter you can use an XMLDBSource to write the file directly into eXist from your flowscript. Jonas Lundberg wrote: The xquery stores the XML file in eXist.

Re: How to return xml from a flowscript?

2006-01-05 Thread Jonas Lundberg
Thanks, yes that would be a good way to store the document. (I currently do that using XSP) However, I should add that the xQuery is the core of a content management system, so it also does version management, among other things, (while storing the file). Therefore, storing a temporary file, does

Re: How to return xml from a flowscript?

2006-01-05 Thread Geert Josten
So, what you are saying now is that you cannot pass an xml document as a parameter in Cocoon, at all? What do you mean with xml document and what with parameter? The parameters you pass from FlowScript can contain any object type, but I'm pretty sure that map:parameter does not allow that.