cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunsberger, Peter" <>
Subject RE: XMLForm & JSF
Date Tue, 08 Apr 2003 19:18:44 GMT
Bruno Dumon <> wrote:

> And actually, yes, we need to swap "," and "." :-)
> (dot is the thousands separator over here -- it's the inverse 
> of the US
> conventions)

I knew that actually (I was just ducking the issue so I wouldn't have to
write the illustrative code)....

> But if one needs to repeat this same approach (which seems 
> like a hack to me) for all fields to be validated, multiplied 
> with all the locales to be supported, then I much prefer to 
> simply use Java's
> NumberFormat.parse() method.
> And we haven't talked about dates yet...

Fun? Wow.... 

The number of different formats for different locales isn't that bad for
number formats, but you're right that dates start to get interesting.  The
solution is obvious: force ISO formatting on all your end users. <ducking
and running for cover/>

Seriously, I suspect it's not really possible to do inverse I18N
transformations: something nags at me that the inverse transformation is not
always well defined and that in general you'll need procedural code to
arrive at a canonical format for validation?  In theory Schematron can
perform any transform required, but you're right that it could get messy
(and/or verbose). Ideally the answer would be a standard set of Schematron
conversions to canonical XML formats for inclusion in any other Schematron
(the point being that this only needs to be done once, then it can be
referenced everywhere). 

Hmmm, this may be worth bouncing around on XML-dev there are a lot of
Schematron proponents there who must have run into this... 

View raw message