You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Binkley, Peter" <Pe...@ualberta.ca> on 2005/03/15 22:46:27 UTC

binding on element name

Here's a binding question. I'm working with a record structure that can
have seven different date fields, which are distinguished by element
name: <dateIssued>, <dateCreated>, etc. They all have the same internal
structure (several attributes, text content), and they're all optional
and repeatable. Sounds like an ideal place to use a repeater widget
called "dates", with a field called "type" in each row. This would be
easy if the XML structure were "<date type='dateIssued'...>", but it
isn't. I'm trying to figure out how to treat it as if it were.

First problem: can I use xpath-style boolean operators in the row-path
of the repeater? (e.g. row-path="dateIssued | dateCreated | ..."). If
not, is there some other way I can include all seven date elements in
this repeater?

Second problem: how can I bind the element name to the type field? I
need a <dateIssued> element to come into the repeater as a row with
type="dateIssued", etc. I also need to able to change its type to
"dateCreated" in the form and have it written back to the XML output as
a <dateCreated> element. Custom binding will obviously be necessary but
I haven't got far enough into jx to see how to do this.

Can someone point me to some sample code that does something similar, to
get me started?

Thanks for any help,

Peter

peter.binkley@ualberta.ca

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org