[ http://issues.apache.org/jira/browse/COCOON-905?page=comments#action_12415847 ]
Ellis Pritchard commented on COCOON-905: ---------------------------------------- Broken in 2.1.8: e.g. <jx:comment>foo bar</jx:comment> produces ArrrayIndexOutOfBoundsException: -1 Problem is with these lines: 2988 String str = XMLUtils.serializeNode(nodeList.item(i), omit); 2989 buf.append(StringUtils.substringAfter(str, ">")); // cut the XML header If there are no markup-tags in the comment (why would there be?), then nothing is appended to the buffer, which then results in a Xerces error (serializing an empty comment). It seems that the substringAfter() bit is redundant, since the XML header is not being produced due to the 'omit' properties passed into serializeNode(). > JXTemplate evaluates expressions in comments, need jx:comment? > -------------------------------------------------------------- > > Key: COCOON-905 > URL: http://issues.apache.org/jira/browse/COCOON-905 > Project: Cocoon > Type: Bug > Components: - Components: Sitemap > Versions: 2.1.8 > Environment: Operating System: All > Platform: PC > Reporter: Mariusz Sieraczkiewicz > Assignee: Cocoon Developers Team > > The code like this > <jx:forEach select="#{queryWrapper/data}"> > <p> > <jx:out value="#{.}" /> > <!-- > <jx:out value="#{.[4]}" /> > --> > </p> > </jx:forEach> > throws > Original Exception: org.apache.commons.jxpath.JXPathException: No value for > xpath: .[4] > at org.apache.cocoon.generation.JXTemplateGenerator. > characters(JXTemplateGenerator.java:2820) at > org.apache.cocoon.generation.JXTemplateGenerator.execute(JXTemplateGenerator. > java:3495) at > org.apache.cocoon.generation.JXTemplateGenerator.execute(JXTemplateGenerator. > java:3179) at > org.apache.cocoon.generation.JXTemplateGenerator.generate(JXTemplateGenerator. > java:2790) > what means that commented out part of code is evaluated. -- 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