Re: [xsl] Can XPath / XSLT be aware of XML Schema content models grouping i nformation ?

Subject: Re: [xsl] Can XPath / XSLT be aware of XML Schema content models grouping i nformation ?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 9 Nov 2001 17:22:47 +0000
Hi Jerome,

> In fact this is more an hypothetical problem that we may encounter
> than a real world requirement.

Ahh... :) We had a big discussion here a few weeks ago about whether
there were actually any real-world requirements for accessing schema
from XSLT. It seems there are lots of hypotheticals, but very few real
cases, which is why I was quite interested in yours, particularly as
the position of the particle corresponding to an element within a
model group isn't something usually considered as important

> However after reading the article on James Clark in DDJ "A Triumph
> of Simplicity: James Clark on Markup Languages and XML"
> I'm now
> wondering if this inclusion in XPath/XSLT 2.0 would be a good thing,
> especially if you consider XML Schema as just one way to constrain /
> validate an XML document compared to Relax NG, Schematron, XDR, ....

...DTDs. Yes. Technically, the XQuery/XPath 2.0 data model is based on
a PSVI constructed from validating an instance against a schema. It's
unfortunate that the XQuery/XPath data model document highlights XML
Schema as being the source of that PSVI, as there's no real reason why
that should be the only possible source. Indeed, it looks as though
the data model WD will include a mapping of DTD information on to the
data model eventually.

I think it should be feasible to map information from RELAX NG
validation to the data model as currently defined (as long as you're
prepared to have lots of anonymous types). XDR should be straight
forward because it's similar to XML Schema and DTDs.

Of course this is only possible if you let the XQuery/XPath data model
lose information along the way. The full set of information that you
can get out of looking at an XML Schema is far more than the data
model as defined can provide, but if you included that extra
information (e.g. whether a type is a choice, sequence or all model
group) then it would be far harder to provide that information from
other schema languages like RELAX NG (how do you map an interleave,
for example?).

The more information is available in the data model, the more it's
tied to a particular schema language.

[I didn't talk about Schematron in the above because due to the way
it's designed I think it's only purpose is constraint checking, not
generating a PSVI.]



Jeni Tennison

 XSL-List info and archive:

Current Thread