cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Flow and XMLForm
Date Mon, 20 May 2002 21:02:30 GMT


<snip />
> - why do you need XMLForm when you have flow control? You can do the
> same things XMLForm does in the flow layer.

> ;)

> Now seriously, I think there's a lot of overlap between the two
> implementations right now.

> What I think we need is a way to describe, using Schematron, just as
> in XMLForm, the relationships between elements of the XML instance
> document. A stylesheet could then generate the JavaScript validation
> scripts, a set for the client browser, and another one for the server,
> very similar to the one for the client. The flow between pages can
> then be implemented using flow scripts.

> In the above approach, I'm obviously biased towards the flow layer, so
> I'd appreciate some more thoughts on it. What I'd also like to see is
> a way to reuse most of Ivelin's work, as I don't have much experience
> with it.

Are suggesting that the flow layer with the addition of some kind of
Schematron processor could completely replace XMLForm?  And if so, could
you elaborate why you think this would be a better solution?

Also, are you thinking of something like Rhino on the server so that
validation could be done by similar javascript on both client/server?

Finally, I think transforming Schematron to javascript could be very tricky.
Something like <assert test=".!=''"> might be easy enough to transform,
or even <assert test="/NAME_PREFER!=/NAME_ALIAS_FIRST">, but what about
<assert test="not(contains(translate(.,'!@#$%^&amp;*()_+-=0123456789','
The nasty problem here is that the "conditional" part of an assert
is unparsed character data, not xml markup, and so (almost) impossible
to transform.  Seems like you would need to use a constraint description
language that expresses more of its content in "pure" XML (perhaps XMLSchema??).
Or perhaps some even more abstract XML "model/constraint expression syntax"
which could be translated into XMLSchema, Schematron, or client/server
javascript as needed, i.e:
                  <instance-node name="LAST_NAME" type="String" />
            <message>Last Name contains an illegal character.</message>
(A very crude example, but you get the idea...)


To unsubscribe, e-mail:
For additional commands, email:

View raw message