Re: [xsl] keys and idrefs - XSLT2 request?

Subject: Re: [xsl] keys and idrefs - XSLT2 request?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 10 Oct 2001 12:30:14 +0100
Hi Dave,

>> *But* if you have an element that looks the same as one in XSLT
>> 1.0, has XPath expressions that look like XPath 1.0, but actually
>> behaves completely differently, then the XSLT 1.0 processor won't
>> warn you, won't give you an error, it will just go ahead and
>> process the thing, but give completely different results.
> I was hoping that the processor would see 2.0, know it was a 1.0
> processor, and stop, right there, or at least give a warning.

As David's said, this is behaviour defined in XSLT 1.0, so there's
nothing that we can do about it now (the XSLT 2.0 spec can't change
how XSLT 1.0 processors work, though they could make XSLT 2.0
processors work differently to prevent the same kind of problems when
we get to XSLT 3.0 :)

> For this particular case it would only process the first token
> from the idrefs list, as it does today.

What it would do today is take the whole IDREFS string and use that -
XPath 1.0 doesn't automatically break IDREFS attribute values into
individual tokens.

>> I don't know what/whether the XSL WG have decided to do about
>> backwards compatibility in XPath - it probably depends on how much
>> they feel they have to nanny us authors to make sure that we're
>> told when our stylesheets are running under the wrong processors...
> If the WG are going to wrap us in so much cotton wool, I wouldn't be
> best pleased.
> A warning (this particular case) would be the softest I would
> appreciate, it would at least let me know that something is awry.
> I still like the first solution, just a bit of logical extension.

>From Mike's response ("In fact, if you have a schema that declares
@attr to be a sequence data type, then you won't even need to do this,
you'll get the sequence automatically."), it sounds as if that's what
you're going to get.

So then all you have to worry about is that the stylesheet won't work
in the same way if the DTD's not available or isn't declared in a
particular instance document (it's always a slight issue, because of
default attribute values and id(), but it has much more impact now).



Jeni Tennison

 XSL-List info and archive:

Current Thread