Re: pipeline dependencies
As quoted from Upayavira [EMAIL PROTECTED]: Is it possible to define pipeline dependencies in the sitemap? Imagine I have two pipelines A and B. Pipeline B has a SourceWritingTransformer and all it does is writing a generated document on the filesystem. Pipeline A has its own generator and transformer but it depends on the document written by B. So A denpends on B. In other words when A is called B has to be called first but the output of A sould be serialized to the browser (and not the output of B). You could try just including pipeline B in with pipeline A using cocoon:, e.g. map:match pattern=B map:generate... map:transform type=SWT map:serialize type=xml/ /map:match map:match pattern=A map:aggregate element=foo map:part src=cocoon:/B/ map:part src=a-src.xml/ /map:aggregate map:transform... map:serialize... /map:match If you can get pipeline B to cache, then it will only write if the source of that pipeline has changed. Then, if necessary, you can ignore the aggregated output from pipeline B, but it is just there to enforce the dependency. All depends upon the caching of the SourceWritingTransformer. Thanks Upayavira. I think with the current implementation that is the only possible way of doing it. Although it's not efficient (you dont actually want to aggregate), it serves the purpose. Regards, Upayavira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: pipeline dependencies
As quoted from Upayavira [EMAIL PROTECTED]: Another way you can do it is read your original content from disc, then transform it into something like: xml source:write contentBlah/content /source:write contentBlah/content /xml This way you repeat your content twice, once to go into the SWT, and once to go on to the output. Your following transformer then just strips out any nodes in the SWT namespace. Make sense? Can you explain a little more _why_ you want to be writing to disk? That'll help me understand how best you can achieve your requirements. The thing is I generate a stylesheet in B which is used in A (and in other pipelines): match pattern=B map:generate src=resources/{filename}.xml/ map:transform src=styles/Meta_output.xsl/ map:serialize type=xml/ /map:match Note that the output of B is a stylesheet (say output.xsl). Then the first thing that comes to mind is using the Cocoon protocol to read this output.xsl as the src of the transformer in A: match pattern=A map:generate src=resources/bla.xml/ map:transform src=cocoon:/B/ map:serialize type=html/ /map:match But unfortunately this does not work. (I have posted messages on this matter a few days ago). The output of A is not what it should be at all. So I thought a workaround is to write the output.xsl to file and then read it in A. But then I had the issue of dependencies I hope i have been clear enough. By the way have you ever tried to use cocoon:/ as the src of a Transformer? Thanks, Ali Regards, Upayavira map:match ... map:generate src=original source map:transform src=make_ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: pipeline dependencies
As quoted from Upayavira [EMAIL PROTECTED]: Ali, Have you seen: http://wiki.cocoondev.org/Wiki.jsp?page=MetaStylesheets Maybe that'll help. It works indeed. I see what I was doing wrong; In my Meta_output at some places I had something like: xsl:text disable-output-escaping=yes lt;xsl:apply-templatesgt; lt;xsl:with-param name=path select=$root/gt; lt;/xsl:apply-templatesgt; /xsl:text This works if you save the output on filesystem and read it again but not using it directly via Cocoon protocol. The trick is to create elements explicitely instead of using xsl:text: xsl:element name=xsl:apply-templates xsl:element name=xsl:with-param xsl:attribute name=namepath/xsl:attribute xsl:attribute name=select xsl:text$root/xsl:text /xsl:attribute /xsl:element /xsl:element Thanks Upayavira for helping out, Ali Regards, Upayavira On 20 Jun 2003 at 11:16, Ali Mesbah wrote: As quoted from Upayavira [EMAIL PROTECTED]: Another way you can do it is read your original content from disc, then transform it into something like: xml source:write contentBlah/content /source:write contentBlah/content /xml This way you repeat your content twice, once to go into the SWT, and once to go on to the output. Your following transformer then just strips out any nodes in the SWT namespace. Make sense? Can you explain a little more _why_ you want to be writing to disk? That'll help me understand how best you can achieve your requirements. The thing is I generate a stylesheet in B which is used in A (and in other pipelines): match pattern=B map:generate src=resources/{filename}.xml/ map:transform src=styles/Meta_output.xsl/ map:serialize type=xml/ /map:match Note that the output of B is a stylesheet (say output.xsl). Then the first thing that comes to mind is using the Cocoon protocol to read this output.xsl as the src of the transformer in A: match pattern=A map:generate src=resources/bla.xml/ map:transform src=cocoon:/B/ map:serialize type=html/ /map:match But unfortunately this does not work. (I have posted messages on this matter a few days ago). The output of A is not what it should be at all. So I thought a workaround is to write the output.xsl to file and then read it in A. But then I had the issue of dependencies I hope i have been clear enough. By the way have you ever tried to use cocoon:/ as the src of a Transformer? Thanks, Ali Regards, Upayavira map:match ... map:generate src=original source map:transform src=make_ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
pipeline dependencies
Hi, Is it possible to define pipeline dependencies in the sitemap? Imagine I have two pipelines A and B. Pipeline B has a SourceWritingTransformer and all it does is writing a generated document on the filesystem. Pipeline A has its own generator and transformer but it depends on the document written by B. So A denpends on B. In other words when A is called B has to be called first but the output of A sould be serialized to the browser (and not the output of B). Thanks, Ali -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Writing to filesystem
Hi, What is the best way to write the output of a Transformer (in a pipeline) into a file (e.g. /resources/bla.xml) on the filesystem? Thanks, Ali -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Writing to filesystem
As quoted from Upayavira [EMAIL PROTECTED]: Hi, What is the best way to write the output of a Transformer (in a pipeline) into a file (e.g. /resources/bla.xml) on the filesystem? Check out the SourceWritingTransformer. I am checking it out. thanks. I'm getting an error though: failedThere was a problem manipulating your document: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. writenonefile:/resources/result.xml My xml source (called test.xml): ?xml version=1.0 encoding=UTF-8? page source:write xmlns:source=http://apache.org/cocoon/source/1.0; source:sourcecontext://resources/result.xml/source:source source:fragment titleSourceWritingTransformer Test Result 1/title /source:fragment /source:write /page My pileline: map:match pattern=test map:generate src=resources/test.xml/ map:transform type=sourcewriter/ map:serialize type=xml/ /map:match sourcewriter: map:transformers default=xalan map:transformer name=sourcewriter logger=sitemap.transformer.filewriter src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ /map:transformer /map:transformers what am I doing wrong? Thanks, Ali Regards, Upayavira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Writing to filesystem
As quoted from Geoff Howard [EMAIL PROTECTED]: It is complaining about the whitespace nodes between source:frament and title. You'll get this anytime you overwrite a whole document. To fix, just do something like: ... source:fragmenttitleSourceWritingTransformer Test Result 1/title/source:fragment ... Wonderful. Thanks it works :) At 08:39 AM 6/16/2003, you wrote: As quoted from Upayavira [EMAIL PROTECTED]: Hi, What is the best way to write the output of a Transformer (in a pipeline) into a file (e.g. /resources/bla.xml) on the filesystem? Check out the SourceWritingTransformer. I am checking it out. thanks. I'm getting an error though: failedThere was a problem manipulating your document: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. writenonefile:/resources/result.xml My xml source (called test.xml): ?xml version=1.0 encoding=UTF-8? page source:write xmlns:source=http://apache.org/cocoon/source/1.0; source:sourcecontext://resources/result.xml/source:source source:fragment titleSourceWritingTransformer Test Result 1/title /source:fragment /source:write /page - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: strange transform behavior
I also found somewhat the same problem with Transformers. I have a pipeline which makes a stylesheet. I want to use that generated stylesheet as the input of a transformer in a second pipeline. The result of the second pipeline is indeed strange and not what it should be. I tried it with Cocoon 1.0.4 and later with (CVS) Cocoon 1.2 but the outcome is the same. Is this a known bug? Thanks, Ali -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exception JSPReader.generate()
Hi all, I get the following error when I try to run the JSP samples. I have Cocoon 2.1 and I run it as a servlet (which uses Jetty): org.apache.cocoon.ProcessingException: Exception JSPReader.generate(): java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet The jsp-engine is defined as follows in the cocoon.xconf: jsp-engine logger=core.jsp-engine parameter name=servlet-class value=org.apache.jasper.servlet.JspServlet/ parameter name=servlet-name value=*.jsp/ /jsp-engine This is for when you run Cocoon as a webapp under Tomcat I assume. But what should it be when Cocoon runs as a standalone servlet (./cocoon servlet)? Thanks, -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Document function
Hi all, I'm getting a strange XML Parsing Error: syntax error from Cocoon while I try to transform an XML document with an XSLT which uses the Document function. XSLT (metaoutput.xsl): ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:output method=xml indent=yes/ xsl:strip-space elements=*/ xsl:variable name='fileurl' select='mapping/vorm.xml'/ xsl:variable name='mapping' select='document($fileurl)/mapping'/ ... Error: XML Parsing Error: syntax error Location: http://localhost:/metaoutput Line Number 2, Column 1: There is no Error message logged. This is what I get on the browser. Does it have something to do with Xalan? Any ideas? Thanks, Ali -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
internal pipeline
Hi all, I have a problem and don't know if it is a bug in Cocoon or if I'm doing something wrong. What I have is a pipeline which transforms an XML (source) file into an XSLT (target) stylesheet: map:match pattern=xms/test map:generate src=xms/resources/combined.xml/ map:transform src=xms/styles/Meta_output.xsl/ map:serialize type=xml/ /map:match now I'd like to use the output as the source of another pipeline: map:match pattern=view/* map:generate src=xms/resources/{1}.xml/ map:transform src=cocoon:/xms/test/ map:serialize type=html/ /map:match I don't get any errors but the HTML output of the view pipeline is not the expected (I have checked the output of the first pipeline and that is correct. I assume it has something to do with the way I use cocoon:/... as the source of the second transformer). Any ideas? Thanks, -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: internal pipeline
Andreas, As quoted from Andreas Hartmann [EMAIL PROTECTED]: Hi Ali, Ali Mesbah wrote: Hi all, I have a problem and don't know if it is a bug in Cocoon or if I'm doing something wrong. What I have is a pipeline which transforms an XML (source) file into an XSLT (target) stylesheet: map:match pattern=xms/test map:generate src=xms/resources/combined.xml/ map:transform src=xms/styles/Meta_output.xsl/ map:serialize type=xml/ /map:match now I'd like to use the output as the source of another pipeline: map:match pattern=view/* map:generate src=xms/resources/{1}.xml/ map:transform src=cocoon:/xms/test/ map:serialize type=html/ /map:match I don't get any errors but the HTML output of the view pipeline is not the expected (I have checked the output of the first pipeline and that is correct. I assume it has something to do with the way I use cocoon:/... as the source of the second transformer). Any ideas? Your pipelines look OK (if I didn't miss anything). You're using the cocoon: protocol correctly. I also tried this kind of stylesheet generation (using XSP) and it worked very well. So I guess your problem is somewhere in the last transformation step. You can try to set the log level to DEBUG and look at the sitemap log to see if the correct steps are executed. No. There is a major difference between the log information when the xms/test pipeline is called directly and when it is called by the second pipeline through the Cocoon: protocol. I even added a LOG Transformer after the first pipeline; when using Cocoon: protocol, this log file remains empty: ([setup] [Thu Jun 05 11:59:01 CEST 2003] --) while when called directly it is filled by all the right steps. The next debugging step could be to save the output of your first pipeline as an XSLT file and to use this directly without the cocoon: protocol. Did that too. And indeed when I save the output of the first pipeline and use it as a normal source for the second (view) pipeline it goes as wished. So I think my assumption was correct that it has to do with the use of the Cocoon: protocol as the src of a transformer. Have you ever by the way used it in this way too (Cocoon: as the src of XSLT (not XSP) via pipelines)? HTH, Andreas -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic sitemap
Hallo, I need to add new pipelines to the sitemap dynamically. Is there any way of doing this?? Thanks, -- -- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]