Marc Portier wrote:
Sylvain Wallez wrote:
Timothy Larson wrote:
--- Sylvain Wallez <[EMAIL PROTECTED]> wrote:
Hehe, thinking before coding is often a good thing ;-)
Actually I coded it a few weeks ago and only started thinking when I considered committing the code =:)
Well, at least you think before committing ;-P
Why don't you do it the way it's done in the <wb:value> binding? For binding to an XML document, it is possible to specify a convertor, that can be totally different from the one that will be used to display the value to the user. Note that this converter is optional, and if not present, the default converter for the datatype is used.
Sounds good, something like this?
<wd:default>
<wd:convertor datatype="" type="">
<!-- bla bla bla/ -->
</wd:convertor>
<wd:value>Put default value to be converted here</wd:value>
</wd:default>
This still leaves the question of how to figure out the locale of the definition file.
Mmmh... We must have a way to define it somehow. Should it be defined on each <wd:default>, or on some enclosing element like the <wd:form> itself?
Or can't we simply use the xml:lang attribute, meaning we crawl up the XML elements starting at <wd:convertor> until we find this attribute?
xml:lang sounds good and instead of crawling up the builder could just get this from some growing build-context from it's parent, no?
2nd thought... I just asked Steven about value of xml:lang.
Seems (top of head, not checked with spec) like it is targetted at language-code only, which might be a mismatch to Java's locale-code which also allows for country-variants..
regards, -marc=
one other remark though: values should be simple strings, no?
the fact that we allow it as a text-node almost invites people to stretch it into rich-content-model?
<wd:default> <wd:convertor ... /> <wd:value set="Put default value to be converted here." /> </wd:default>
but maybe I'm just nitpicking?
Sylvain
-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]
