On Dec 1, 2006, at 9:30 AM, Gabriele Columbro wrote:

Not sure about JXPath but I suppose it should be possible in the exact same way it is possible in the JXTemplate (not sure though, so better try it) more or less like:

${cocoon.request.getParameter('foo') }

If this were supported (see below), it would not be like JXT syntax! :-)

JXPath [1] is an interpretation of Xpath [2] for Java object graphs. With some funny quirks [3].

So in a CForms binding, I guess (IIRC what you're trying to do) the JXPath would have to be something like this:

        /foo/[EMAIL PROTECTED] = $cocoon/request/parameter/beer]

However, I don't see anything in the source code that suggests we are injecting the cocoon FOM object into the JXPath context. That could easily be done, I guess.

Using FOM objects to dynamically drive the forms binding does seem exotic, though. Care to share some more details about your use case for this? I'd be interested to hear...

Anyway, think you'll have to do this part of the load/save by hand, in flowscript. Assuming your binding has other things to do besides the part that depends on FOM objects, I would suggest using your load/save normally using the binding framework for the "normal" parts, then doing the dynamic "binding" parts by hand in flowscript. You could even still use JXPath for this (by hand), building your path expression using string concatenation.

HTH,
—ml—

[1] http://jakarta.apache.org/commons/jxpath
[2] http://www.w3.org/TR/xpath
[3] http://jakarta.apache.org/commons/jxpath/users-guide.html#Attributes

Reply via email to