From dev-return-96110-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Tue Aug 14 19:42:10 2007 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 17746 invoked from network); 14 Aug 2007 19:42:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2007 19:42:03 -0000 Received: (qmail 86561 invoked by uid 500); 14 Aug 2007 19:41:57 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 86500 invoked by uid 500); 14 Aug 2007 19:41:57 -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 86489 invoked by uid 99); 14 Aug 2007 19:41:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 12:41:57 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 19:42:07 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 665AA7141F2 for ; Tue, 14 Aug 2007 12:41:30 -0700 (PDT) Message-ID: <20916270.1187120490407.JavaMail.jira@brutus> Date: Tue, 14 Aug 2007 12:41:30 -0700 (PDT) From: "Hugh Sparks (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects In-Reply-To: <3697720.1186679143725.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519753 ] Hugh Sparks commented on COCOON-2108: ------------------------------------- I'd like to propose a very slight improvement to the suggested repair in the JXPathHelper getAttribute method: Instead of using: Object obj = jxContext.getPointer(name).getNode() ; return obj ; I think it might be better to use: return jxContext.selectSingleNode(name) ; The code in selectSigngleNode uses getPointer followed by getNode, but it checks the result returned by getPointer and if it is null, it returns null rather than going ahead with getNode, which would cause an exception. Also, in the above change, I've eliminated the local variable "obj". ******************** I setup cocoon for java debugging and put a breakpoint at the modified line. The code is hit constantly by nearly every sample and appears to work correctly. Next, I made the same change in a recent svn checkout of the cocoon 2.2 truck. To the extent that it worked before, it seemed none the worse. It would appear that this change is safe and that it restores an major broken feature in xmodule. > xmodule:flow-attr Does not accept document objects > -------------------------------------------------- > > Key: COCOON-2108 > URL: https://issues.apache.org/jira/browse/COCOON-2108 > Project: Cocoon > Issue Type: Bug > Components: * Cocoon Core > Affects Versions: 2.1.11-dev (Current SVN) > Reporter: Hugh Sparks > Priority: Minor > Attachments: xmodulePuzzle.txt > > > Sending document objects from flowscript back to the pipeline using > xmodule:flow-attr produces unexpected results. Also, the examples from > the documentation do not work as described: > http://cocoon.apache.org/2.1/861.daisy.html > The most common error reported is: > 'The object type: class java.lang.String could not be serialized to XML" > This issue was discussed recently on the cocoon-users mailing list. > The thread was introduced by Kazo Csaba with the subject "Sending DOM from flowscript to pipeline." > (July 17, 2007) > He has attempted to trace this behavior in the source code and believes that a > possibly-inappropriate conversion to string occurs in some cases. > Jason Johnston suggested moving the issue to JIRA. > I've created a demonstration of this apparent bug and some related problems > in this very brief example: > http://www.csparks.com/xmodulePuzzle.txt > I hope someone can fix or explain the correct usage of xmodule:flow-attr. > Thanks to all, > -Hugh Sparks, hugh@csparks.com -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.