You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Hugh Spark (JIRA)" <ji...@apache.org> on 2007/08/09 19:05:43 UTC

[jira] Created: (COCOON-2108) xmodule:flow-attr Does not accept document objects

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 Spark
            Priority: Minor


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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519231 ] 

Hugh Sparks commented on COCOON-2108:
-------------------------------------

Grzegorz Kossakowski wrote:
> ...
> Thanks Hugh for your great research!

The brain work was done by Csaba Kazó.

****************

Jörg Heinicke wrote:

> Hugh, did you try text()? 

Indeed I did. And I commented that it didn't work.
But I was wrong! The example I set up was done in haste.
Appending /text() to the path works correctly.

So perhaps the getAttribute method in class  JXPathHelper could be patched?

The Javadocs show that getAttribute is supposed to return Object...

I find direct references to JXPathHelper getAttribute in:

    AbstractJXPathModule.java
    JXPathHelper.java
    JXPathHelperConfiguration.java
    JXPathMetaModule.java
    XMLFileModule.java

I tried running most of the samples and tests in my modified
Cocoon-2.1.11 and nothing was obviously broken. But I don't know of anything like a regression test suite for Cocoon.

Making a change like this could have far-reaching consequences.
Perhaps it's time to send a letter to the developers of the package
and ask them to review this thread.

In any case, I'm new here and I don't know what to do next...


> 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.


[jira] Assigned: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski reassigned COCOON-2108:
--------------------------------------------

    Assignee:     (was: Grzegorz Kossakowski)

I don't plan to work on this issue in foreseeable future so I leave it unassigned.

> 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, 2.2
>            Reporter: Hugh Sparks
>            Priority: Minor
>             Fix For: 2.1.12-dev (Current SVN), 2.2
>
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Updated: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hugh Sparks updated COCOON-2108:
--------------------------------

    Attachment: Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch

Patch for BRANCH-2.1.X


> 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: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Reopened: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers reopened COCOON-2108:
---------------------------------


This patch causes XMLFileModule and anything based on AbstractJXPathModule or JXPathMetaModule to fail as they no longer receive the value of the element. 

> 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), 2.2-dev (Current SVN)
>            Reporter: Hugh Sparks
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>             Fix For: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
>
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Updated: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hugh Sparks updated COCOON-2108:
--------------------------------

    Attachment: Cocoon-2.2-truck-JXPathHelper.java.patch

Patch for cocoon truck

> 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: Cocoon-2.2-truck-JXPathHelper.java.patch, 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519770 ] 

Hugh Sparks commented on COCOON-2108:
-------------------------------------

I've attached two files, one for today's checkout of the truck:

    Cocoon-2.2-truck-JXPathHelper.java.patch

And also a patch for 2.1.X: (Is this the right place for 2.1.11 candidates?)

    Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch

It would be nice to get the 2.1.X patch in for the release of 2.1.11  :-)

Thanks to all, especially Csaba Kazó, who figured out what to do.
I hope it doesn't break anything.


> 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: Cocoon-2.2-truck-JXPathHelper.java.patch, 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519151 ] 

Hugh Sparks commented on COCOON-2108:
-------------------------------------

I tried the fix suggested by Csaba Kazó and it made all the test cases in
xmodulePuzzles.txt work as expected.

Now the question becomes, "what else is broken if this fix is left in place"?
(I tried to find some jxpath usage in the Samples, but without success.)

One possible motive for using getValue() in the original code was to make it possible
to get the actual string values of an jxpath expression. Recall the xmodule allows
a path to be appended:

For the xml:

    <test>This is <inside>a test</inside>of xmodule</test>

The expression:

     xmodule:flow-attr:message#test/inside

Gives this result if we use Csaba Kazó's fix:

    <inside>a test</inside>

Because the text() function is missing from Cocoon's jxpath,
there is no way to recover the text inside using an xmodule
expression in the sitemap.

It seems to me that a possible solution would be to use Kazó's 
suggested change, but add the text() function to jxpath so this
expression would return the contents of the element:

    xmodule:flow-attr:message#test/inside/text()

= "a test"

Is jxpath supposed to have a text() function?

************************


> 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.


[jira] Updated: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski updated COCOON-2108:
-----------------------------------------

           Other Info: [Patch available]
    Affects Version/s: 2.2-dev (Current SVN)

> 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), 2.2-dev (Current SVN)
>            Reporter: Hugh Sparks
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Updated: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hugh Sparks updated COCOON-2108:
--------------------------------

    Attachment: xmodulePuzzle.txt

I've attached the document referenced in the previous
post to my website. (I'm new to JIRA and didn't notice
this was possible.)

-Hugh Sparks




> 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.


[jira] Closed: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski closed COCOON-2108.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2-dev (Current SVN)
                   2.1.11-dev (Current SVN)

Fixed in r575803 (trunk) and in r575808 (2.1.x branch).

Thanks for reporting and providing patches.

> 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), 2.2-dev (Current SVN)
>            Reporter: Hugh Sparks
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>             Fix For: 2.1.11-dev (Current SVN), 2.2-dev (Current SVN)
>
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519156 ] 

Grzegorz Kossakowski commented on COCOON-2108:
----------------------------------------------

After taking quick look at[1] we can see following statement:

     The intepretation of XPath over DOM/JDOM structures is implemented in accordance with the XPath specification.

Since XPath defines text() function it should work perfectly. I think this direction is surely worth trying.

Thanks Hugh for your great research!

[1] http://commons.apache.org/jxpath/users-guide.html#DOM_JDOM_Document_Access

> 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.


[jira] Updated: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Heinicke updated COCOON-2108:
----------------------------------

    Fix Version/s:     (was: 2.1.11)
                   2.1.12-dev (Current SVN)

> 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, 2.2-dev (Current SVN)
>            Reporter: Hugh Sparks
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>             Fix For: 2.1.12-dev (Current SVN), 2.2-dev (Current SVN)
>
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Assigned: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski reassigned COCOON-2108:
--------------------------------------------

    Assignee: Grzegorz Kossakowski

> 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), 2.2-dev (Current SVN)
>            Reporter: Hugh Sparks
>            Assignee: Grzegorz Kossakowski
>            Priority: Minor
>         Attachments: Cocoon-2.2-truck-JXPathHelper.java.patch, Cocoon-BRANCH-2.1.X-JXPathHelper.java.patch, 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519180 ] 

Jörg Heinicke commented on COCOON-2108:
---------------------------------------

Hugh, did you try text()? If JXPath has implemented the function (and I think so) it should work. I think we only pass the expression directly to JXPath.

> 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Csaba Kazó (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518811 ] 

Csaba Kazó commented on COCOON-2108:
------------------------------------

My evaluation in the above mentioned thread can be found here: http://www.mail-archive.com/users@cocoon.apache.org/msg39242.html

To sum up, I've found that the flow attribute module obtains the string value instead of the original domain object when calling into JXPath; this call is in JXPathHelper.getAttribute, line 96:

  Object obj = jxContext.getValue(name);

Here, a jxContext.getPointer(name).getNode() call would return the correct DOM object. I can imagine that the solution to the bug is as simple as this, although my understanding of JXPath is limited.

If you quickly need a workaround, you can easily create a small replacement input module subclassing AbstractInputModule that simply gets the domain object without any JXPath traversal.

> 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Hugh Sparks (JIRA)" <ji...@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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519763 ] 

Grzegorz Kossakowski commented on COCOON-2108:
----------------------------------------------

Hugh, I agree with all you said so far. I'm also glad to see that you tested your solution thoroughly.

I think that the next step would be providing a patch. I'm especially interested in a patch for trunk and I'll be happy to commit it as soon as you provide the patch.
Also, if there is some obscure use of getAttribute() method that relies on buggy functionality we should fix it. Since it's hard to discover such hypothetical code we just must let new code go into wild and see what happens.

> 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.


[jira] Commented: (COCOON-2108) xmodule:flow-attr Does not accept document objects

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518804 ] 

Grzegorz Kossakowski commented on COCOON-2108:
----------------------------------------------

Hugo, thanks for your comprehensive example of xmodule usage. However, could you attach it directly to the issue? This way we can be sure that your gem will not get lost for any reason.

Thanks in advance.

> 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
>
> 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.