cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: [cforms] default values and locale
Date Tue, 23 Dec 2003 07:37:43 GMT


Sylvain Wallez wrote:
> Timothy Larson wrote:
> 
>> --- Sylvain Wallez <sylvain@apache.org> 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?

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/
mpo@outerthought.org                              mpo@apache.org


Mime
View raw message