cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugh Sparks (JIRA)" <>
Subject [jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects
Date Tue, 14 Aug 2007 19:41:30 GMT


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:
>             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:
> 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:
> I hope someone can fix or explain the correct usage of xmodule:flow-attr.
> Thanks to all,
> -Hugh Sparks,

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message