Re: [xsl] XSLT/XPath 2.0 (was "Identifying two tags...")

Subject: Re: [xsl] XSLT/XPath 2.0 (was "Identifying two tags...")
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 10 May 2002 11:48:06 +0100
Hi Dan,

> Thanks for the tip! I'll most certainly do that (although I fear
> that "I'd like to be spared of 80% of the spec" is not exactly what
> the WG would like to hear...).

Yeah well, they might not want to hear it, but if enough people say it
enough times perhaps they might start having to. And I do think that
they're genuinely interested in learning what users think, especially
about *which* 80% they don't like. I posted my 80% list to XML-Dev
yesterday (because it came up there; I've previously made most of
those comments both here and on the proper comments lists as well) --
have a look at

> What you're saying is really food for though: if you of all people
> are having a hard time "getting your head around" the intricacies of
> the type system in XSLT 2, what are my (and other, more average
> Joes' out there) chances? And even if I did take 6 months off for
> quality time with XQuery semantics and friends, what good would it
> do me (besides the obvious bragging rights)?

I have the feeling that much of what makes XPath/XSLT 2.0 seem
complicated is simply that it hasn't been described well. If you're
had your head buried in the details for months, then it's often hard
to write it down without skipping over the assumptions that you've
come to take for granted, or spending too long on the exceptional,
difficult cases. Again, we can help here by asking the dumb questions,
like "what's the difference between 'treat' and 'assert'?"

> Heck, I can't even quite grasp what that PSVI thingy is supposed to
> be (it's one of those "almost, but in reality: no" things). Since
> all the other stuff seems to be built on that, I'll admit that my
> chances look quite slim.

The PSVI is the stuff that you get out of validating an instance
document with an XML Schema. You know that if you validate an instance
against a DTD, it's different from what you get if you look at the
instance without the DTD? With the DTD, you get additional defaulted
attributes, plus you get information about the types of attributes,
like "this is an ID attribute". In some data models, you also get the
element and attribute declarations, so you can refer to them later on.

What parts of that set of information an application actually needs to
know depends on the application. XPath 1.0, for example, doesn't care
about element or attribute declarations, or about most of the data
types aside from ID attributes, but it does keep the defaulted

The PSVI is exactly the same thing, except it's what you get after
schema validation. It's the same instance as you get normally, with
extra defaulted/fixed values, and indications of the types of elements
and attributes. You get element and attribute declarations, just like
from a DTD. Plus, because you have user-defined types in XML Schema
and they're all part of a hierarchy, you get the type hierarchy as
well. There are a few other things, but that's the important stuff.

Like XPath 1.0, XPath 2.0 picks and chooses from this set of
information to build up its data model. It keeps hold of information
about the types of particular elements and attributes, and some
information about the type hierarchy (like how types are derived from
each other).

I found that looking at the PSVI output of XSV
(, which is described at, helped to
visualise what it looked like; just remember that it wouldn't normally
be passed around as an XML structure!



Jeni Tennison

 XSL-List info and archive:

Current Thread