Sylvain Wallez wrote:

Marc Portier wrote:



Sylvain Wallez wrote:

Carsten Ziegeler wrote:

If I'm binding an XML document to a form, is it possible to use namespaces in the binding? (The bound data has namespaces)



The solution I've used successfully up to now is to bind to a document that already has a root element which holds the namespace definitions with the same prefixes as those used in the binding. This works thanks to o.a.c.util.jxpath.DOMFactory.



good remark: this one should be in sync!



Sorry, in sync with what?


with true namespace-support? meaning the 'same-prefix' limitation could then be removed maybe

Now, as mentioned, the recent JXPath 1.2 has added real support for namespaces, which may allow us to use the namespaces used in the binding file without the previous trick.



didn't know about the new release, I would propose to allow

namespace-definitions on the level of the jxpathbindingbase then, it should glob all xmlns: stuff that was on his corresponding definition element, and then
- set those to the jxpath context
- execute actual binding (possibly delegates to children)



Exactly.

- (is it possible?) remove them again (as other siblings might have used same prefixes to other ns-uri's?)



Why so? Each binding will have its own set of namespaces (built by analyzing the ancestor tree), meaning there is no overlap between siblings.



good remark, in my head I wasn't looking in the ancestor tree, since it would get applied implicitely by adding them to the context as we got down the structure (but then need to be able to remove again)


it kinda depends on
- 'is remove possible' and
- 'isn't setting it continuously on every node going to slow things down?'

like that every wb:* could allow to have local xmlns stuff declared...



regards, -marc= -- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]

Reply via email to