Hello, This doesn't work for me for some reason. I get an error (see end of this message).
My code snippet is: public class XMLInjectAction extends AbstractAction { public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters params) { Map sitemapParams = new HashMap(); String xml="<content><h1>Automatically Generated By Action: Hello</h1></content>"; sitemapParams.put("paramAction", xml); return sitemapParams; } } And my sitemap entry is: <map:match pattern="xmlaction"> <map:act type="xml-injection"> <map:generate> <map:parameter name="param" value="{paramAction}"/> </map:generate> </map:act> <map:transform src="demo/welcome.xslt"/> <map:serialize type="xhtml"/> </map:match> The error I get is as follows: 2008-03-25 00:28:50,812 btpool0-1 ERROR cocoon - Internal Cocoon Problem org.apache.cocoon.ProcessingException: Failed to process pipeline at <map:serialize type="xhtml"> - file:///c:/1/skunk-neuvoip/neuvoip/./src/main/resources/COB-INF/sitemap.xmap:47:33 at <map:transform> - file:///c:/1/skunk-neuvoip/neuvoip/./src/main/resources/COB-INF/sitemap.xmap:46:44 at <map:generate> - file:///c:/1/skunk-neuvoip/neuvoip/./src/main/resources/COB-INF/sitemap.xmap:42:20 at <map:match> - file:///c:/1/skunk-neuvoip/neuvoip/./src/main/resources/COB-INF/sitemap.xmap:40:34 at org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:143) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:921) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:370) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:727) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:464) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:409) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:72) at $Proxy8.process(Unknown Source) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:55) at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:87) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:151) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:240) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:171) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:251) at org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:357) at org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:171) at org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:567) at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:544) at org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:230) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy5.service(Unknown Source) at org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:102) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServlet.service(ReloadingServlet.java:89) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:119) at org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServletFilter.doFilter(ReloadingServletFilter.java:50) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.apache.cocoon.servlet.DebugFilter.doFilter(DebugFilter.java:169) at org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServletFilter.doFilter(ReloadingServletFilter.java:50) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingSpringFilter.doFilter(ReloadingSpringFilter.java:69) at org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServletFilter.doFilter(ReloadingServletFilter.java:50) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) Caused by: java.net.MalformedURLException: Invalid System ID at org.apache.cocoon.components.source.CocoonSourceResolver.resolveURI(CocoonSourceResolver.java:109) at org.apache.cocoon.components.source.CocoonSourceResolver.resolveURI(CocoonSourceResolver.java:182) at org.apache.cocoon.generation.FileGenerator.setup(FileGenerator.java:108) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:341) ... 58 more Joerg Heinicke wrote: > > On 17.03.2008 19:48, shai200 wrote: > >>>From the first glance at the Cocoon Core 2.2 documentation >> (http://cocoon.apache.org/2.2/core-modules/core/2.2/1270_1_1.html), it is >> unclear whether a String result of an Action (or perhaps a value passed >> through the Map and Action returns) can be used to inject as the XML >> content >> generated by the generator, down the pipeline. >> >> If this is possible, how would I go about it? > > Yes, it is: > > <map:act> > <map:generate> > <map:parameter name="param" value="{paramAction}"/> > </map:generate> > </map:act> > > 'paramAction' has to be an entry in the map returned by the action. > > Joerg > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-inject-the-result-of-an-action-into-a-generator-tp16108820p16268117.html Sent from the Cocoon - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]