Hi Andrew,
Andrew Savory wrote:
We'd like to handle xml nodesets in our forms, for example:
<template name="foo">
<textarea id="/document/bar" />
</template>
... where the document is something like:
<document>
<bar>
<foo>
<x>y</x>
</foo>
</bar>
</document>
At the moment I can't see how to do this as the only layout widget that can
handle nodesets seems to be the htmlarea, which in turn insists on something
resembling HTML.
I could attack the HTMLCleanerConfiguration.xml and add all possible
elements, but that seems like a horrible solution.
I could use binding javascript as defined at
http://hippocms.org/display/CMS/Template+Business+Logic+definition and munge
DOMs, but this also seems horrible (and requires a painful upgrade to 6.06).
Any other suggestions?
It could be worth a try to do something like this in the business logic:
<rule for="/document/bar">
<binding-class>nl.hippo.cocoon.forms.binding.XmlAsStringBinding</binding-class>
</rule>
Maybe you can use that XmlAsStringBinding class [1] which comes with the
CMS, maybe you have to write you own (which should be pretty
straightforward).
I did not test this but I wouldn't be surprised if it works :)
Kind regards
Niels
[1]
https://svn.hippocms.org/repos/hippo/hippo-cms/branches/Branch-CMS-v6_05_xx/editor/src/java/nl/hippo/cocoon/forms/binding/XmlAsStringBinding.java
********************************************
Hippocms-dev: Hippo CMS development public mailinglist