Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 42616 invoked from network); 2 Oct 2006 13:17:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 13:17:12 -0000 Received: (qmail 9048 invoked by uid 500); 2 Oct 2006 13:17:09 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 8980 invoked by uid 500); 2 Oct 2006 13:17:09 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 8969 invoked by uid 99); 2 Oct 2006 13:17:09 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 06:17:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:45993] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id EF/C9-16499-A3111254 for ; Mon, 02 Oct 2006 06:16:44 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AADD4714315 for ; Mon, 2 Oct 2006 06:15:58 -0700 (PDT) Message-ID: <31792483.1159794958697.JavaMail.root@brutus> Date: Mon, 2 Oct 2006 06:15:58 -0700 (PDT) From: "Daniele Madama (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-1866) jx:comment doesn't work In-Reply-To: <17646256.1150752509773.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/COCOON-1866?page=comments#action_12439132 ] Daniele Madama commented on COCOON-1866: ---------------------------------------- I try to reproduce the problem but I've no success. I'm using 2.1.10-dev version, but the template block should be the same of 2.2. If I try to use test for jx:comment I receive in output only one empty comment Lookin at the code I find a solution, but I don't know if it is correct Index: src/blocks/template/java/org/apache/cocoon/template/instruction/Comment.java =================================================================== --- src/blocks/template/java/org/apache/cocoon/template/instruction/Comment.java (revision 451947) +++ src/blocks/template/java/org/apache/cocoon/template/instruction/Comment.java (working copy) @@ -59,8 +59,7 @@ for (int i = 0; i < len; i++) { try { String str = XMLUtils.serializeNode(nodeList.item(i), omit); - buf.append(StringUtils.substringAfter(str, ">")); // cut - // the XML header + buf.append(str); } catch (ProcessingException e) { throw new SAXParseException(e.getMessage(), getLocation(), e); } with this *simple* patch if I write: test element test for jx:comment the result is so it seems that it work with text and also with nested elements. I don't know if before there is some cases in which we need to remove the header element. > jx:comment doesn't work > ----------------------- > > Key: COCOON-1866 > URL: http://issues.apache.org/jira/browse/COCOON-1866 > Project: Cocoon > Issue Type: Bug > Components: Blocks: Templating > Reporter: Reinhard Poetz > Fix For: 2.2-dev (Current SVN) > > > jx:comment produces following stack trace in trunk: > java.lang.ArrayIndexOutOfBoundsException: -1 > at org.apache.xalan.serialize.SerializerToXML.comment(SerializerToXML.java:1298) > at org.apache.xalan.transformer.TransformerIdentityImpl.comment(TransformerIdentityImpl.java:1272) > at org.apache.cocoon.xml.AbstractXMLPipe.comment(AbstractXMLPipe.java:228) > at org.apache.cocoon.xml.AbstractXMLPipe.comment(AbstractXMLPipe.java:228) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.apache.cocoon.core.container.spring.PoolableFactoryBean$ProxyHandler.invoke(PoolableFactoryBean.java:340) > at $Proxy5.comment(Unknown Source) > at org.apache.xalan.transformer.ResultTreeHandler.comment(ResultTreeHandler.java:624) > at org.apache.xpath.objects.XString.dispatchAsComment(XString.java:329) > at org.apache.xalan.transformer.ClonerToResultTree.cloneToResultTree(ClonerToResultTree.java:248) > at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:155) > at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425) > at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216) > at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425) > at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216) > at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339) > at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710) > at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339) > at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710) > at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425) > at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216) > at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339) > at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160) > at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213) > at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3372) > at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:433) > at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:54) > at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:577) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira