Kazó Csaba wrote:
Hi,
I'm trying to get a generator to work with a DOM Node that I pass it
from flowscript. The method seems to be described at
http://cocoon.apache.org/2.1/861.daisy.html - basically I do
cocoon.sendPage("page",{input:dom}) in my script and
src="xmodule:flow-attr:input" in my generator. (Well, actually I'm
using PipelineUtil.processToDOM("page",{input:dom}), but I'm pretty
sure it makes no difference.)
Now, this doesn't work. The exception says "The object type: class
java.lang.String could not be serialized to XML:". To be clear, it is
indeed an org.w3c.dom.Node instance and not a String that I pass from
the script. I have actually traced the execution to the point when
the toString() method of the Node is called, so I can provide some
details if necessary.
My understanding of the details of the code is quite little, but I
believe the reason it won't work is that it is a Node instance that
is passed (if I pass a HashMap instance, I get the exception saying
the expected "java.util.HashMap could not be serialized to XML") and
the way JXPath is used by the flow attribute module to access the
attribute.
Right now my question is: how is it supposed to work? I'm not sure if
it was meant to be possible to pass Node objects this way, and there
might be no bug in the current implementation. In this case, is there
a proper way to transfer a DOM object to a sitemap generator?
Otherwise I can provide some details as to what's happening in the
code (though that should rather go to the dev list, shouldn't it?).
I haven't been able to dig into the problem, but I can at least say that
your expectation is exactly right about how it should work. I've done
this many times before exactly as you're attempting, though I think my
particular Node instances have always been Document instances.
If you can give insight into where there may be a bug (you say
toString() is being called somewhere?) or preferably create a patch then
I'll be happy to commit it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]