Michael Kay wrote:
>> But I'm proposing a content-model() function whose only reason for
>> existence is simplification and terseness.
>
> At one stage XQuery did this. It had its own grammar for describing
> content models, with all the paraphernalia of lists and unions and
> sequences, and it allowed you to test whether a particular element
> conformed to a particular content model (so-called "structural
> typing").
Sounds great; anything online?
> Everyone came down on them like a ton of bricks,
:(
> saying W3C
> already had a language for doing that and it was called XML Schema.
They don't seem to like the principle called TIMTOWTDI ... and the one
where one chooses the least powerful tech/lang for each task. (simple
grammar for simple models, full-blown schema lang for complex models)
> So
> they took it all out, leaving just the ability to test whether a
> particular element is a valid instance of a particular schema-defined
> type: "named typing". The result is vastly simpler,
... inside the pattern, but not overall, since the content is described
elsewhere (and I wouldn't call WXS "vastly simple").
> but it does assume
> that you want to define your content models in a schema and not in a
> stylesheet - a reasonable assumption, in my view.
I'd prefer choice. This way, the "structural typing"/content-model()
could stay very terse and simple, and then there would be "named typing"
for all the complex content models which are better described with WXS
or RNG.
But again: What you describe (XSLT2 + XML Schemas(WXS/RNG)) will
probably be a lot more fun than XSLT + XPath1.0 for describing
(matching/testing) content models.
Tobi
--
Vim users donate.
http://iccf-holland.org/donate.html
Web developers check.
http://www.pinkjuice.com/check/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list