Lists Home |
Date Index |
Michael Kay wrote:
>>Granted, but does that require a "dynamically generated" schema?
>If you can think of a better way of maintaining several schemas that are
>identical in most respects, but vary in terms of which elements/attributes
>are optional, then let me know.
>This is a classic "conditional compilation" scenario, and for languages
>based on XML, XSLT provides a powerful tool for such use cases.
I thought it is more a scenario for using derivation by restriction.
But again, I don't rule out the possibility that there are some
contrived schemata where you cannot use restriction.
E.g. if one has used anonymous types instead of named ones! Such
schemata are flawed by design, replacing them with a better schema seems
to me more viable than fixing it with conditional rewriting. I am not
sure if this does not hold for all schemata that some think benefit from
dynamic recreation, but it's hard to prove or disprove. I am eager to
see an example.
My point is, XSD allows to mimick some ideas for object-oriented design
that give you extensibility (and customizability) to some extent. Using
this seems better than patching things up with a stylesheet.