[
Lists Home |
Date Index |
Thread Index
]
Hi Michael
>
> That's actually four levels already: unicode encoding, XML well-formedness,
> schema validity, and application validity. And yes, you often need multiple
> levels.
>
The first 2 levels you mentioned are not configurable. I had lumped the
first 3 stages you have mentioned into one. Schema validity is the
right technical term to use, my humble apologies.
> But that doesn't stop you wanting individual levels to be configurable. A
> very simple example, when I validate new documents I want to check that the
> date is today. That kind of thing is very easily achieved by a configurable
> schema.
With all due respect, this is a trivial example becaue the today context
is implicit. However, I must add that the angle where your idea comes from
is brilliant ! Honestly, I have not thought of this before, but isn't this not
a complex solution to a simple problem ? If I have to do this validation
at the schema level, I would have to factor Today either as a regular
expression or into its facets, taking into consideration 8601 constrains
and time zones. If this is done at the application validity (2nd stage) phase,
it would probably only entail a simple comparison to a Today constant.
I have not taken this path before to discuss in exact implementation
details, so I may be wrong.
The scenario is however vastly different if we are in a workflow app,
external context aside, we cannot assume some state without first
looking into the document right ?
> Equally, the application-level validation is often done using XSLT
> stylesheets, and people often transform stylesheets for the same reason: you
> need things to be configurable at that level too.
>
Sure, my point is that the logical stuffs should be kept here and not
moved into the Schema validity space through dynamic schemas.
I suspect, even if XML Schema evolved to provide conditional
validation in the distant future, we still cannot completely escape
the application-level validation layer. The XML Schema must still
be emphsized as a means to enforce an agreed vocabulary and
not become dependent on application/system semantics.
The trick is therefore to strike the correct balance by putting
each validation requirement into the correct layer.
best rgds,
Kuan Hui
|