Hi Joern et al,
consider the attached Chiba XForms example.
The first input control shows a hard-coded xforms:label with embedded markup,
e.g. a hyperlink in the form label. This works fine right out of the box,
which I was very glad to see.
The second input control attempts to duplicate the same label behaviour by
binding to a document containing the same markup. However, it only renders
text. The reason is that the Chiba processing, which populates label ref=
elements with a copy of the data from the bound node, only seems to copy text.
I was hoping it would copy the complete subtree from the bound element, in
which case field 2 would have worked just like field 1.
I'm wondering whether this behaviour was intentional, or just an oversight, or
not yet implemented?
Now, there are other ways to accomplish the same effect, primarily by having
the XSL make direct references to the bound element. However, this is often a
difficult thing to do, which I guess is why the copying got started in the
first place.
There is a related issue. I tried binding an input control to a compound
element and found that the chiba:data element behaves the same way -- no matter
the structure of the bound data, only the text is copied into the chiba:data
element. (If it had been the entire subtree, I would have had an alternative
way of dealing with the first issue I describe.) See field 4 of the example --
you can understand it better if you look at the Chiba XForms output before the
XSL gets it.
Finally, have I missed some easy way to have the XSL get a direct reference to
the node bound to a particular control? So far, I haven't found one, short of
extra attributes, or possibly some very tricky XSL that could sort of "reverse
engineer" the bind section. From the fact that the chiba:data element copies
in the data (text) from the node, I am led to conclude that there may be no
easy answer without features in the chiba:data behaviour. If so, might you
consider another chiba:data attribute that would provide an easy way for the
XSL to link to the original spot in the instance, instead of having to rely on
the copy in chiba:data? I.e., something like a canonical absolute XPath to the
bound data element?
Thanks in advance for any light you can shed on any of these issues.
Regards,
Paul
Paul Miniato
ProLender Project
labelRefIssue.xhtml
Description: labelRefIssue.xhtml
|