[
Lists Home |
Date Index |
Thread Index
]
Hello Christian,
thank you for answering to Michael and Dimitri. What left for me is to
add some comments.
On Fri, 02 Sep 2005 12:01:49 +0100
Christian Nentwich <christian@systemwire.com> wrote:
> Michael, Dimitri.
>
> you are right it shouldn't be a dark corner, but it IS in practice.
Probably I used an incorrect word. The specification is very clear
explaining the differences. But how often do we read specifications?
Here is my example of a "bug":
<x:variable name="v1" select="false()"/>
<x:variable name="v2"><x:copy-of select="false()"/></x:variable>
I didn't expect that "v2" is RTF, but it is so.
<x:value-of select="not($v1)"/> ===> true
<x:value-of select="not($v2)"/> ===> false
Hm, I've just found a similar example in the specification...
> This does do people's heads in... and it's a source of bugs. I've been
> called on site by clients just to find and fix this particular problem
> quite a few times.
>
> The usual story goes as follows: "ah well we used to use select="" but
> then we had to add some choose and if and had to use a child element".
> Boom.
>
> Christian
>
>
> Michael Kay wrote:
> > This shouldn't be a dark corner, because the fact that nodes have
> > identity is pretty fundamental, but sadly there are lots of people who
> > aren't aware of the implications. The answer of course is (2).
> >
> > Michael Kay
> > http://www.saxonica.com/
> >
> >
> >>-----Original Message-----
> >>From: Oleg A. Paraschenko [mailto:olpa@xmlhack.ru]
> >>Sent: 01 September 2005 20:45
> >>To: xml-dev
> >>Subject: [xml-dev] quiz on select vs copy-of
> >>
> >> Hello,
> >>
> >> do you know the dark corners of XSLT? Here is one. Compare two
> >>variables:
> >>
> >><xsl:variable name="v1" select="some-xpath"/>
> >><xsl:variable name="v2"><xsl:copy-of
> >>select="some-xpath"/></xsl:variable>
> >>
> >> Are "v1" and "v2" the same? I mean: can "v1" and "v2" be used in a
> >>program interchangeably? Answers:
> >>
> >>1) yes
> >>2) no
> >>3) implementation-dependant
> >>
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>.
> >>
> >> The right answer is (2): no. Changing a use of "v1" to
> >>"v2", or reverse,
> >>might change the result of a stylesheet. I'll post an example
> >>later. Or
> >>you can provide your version.
> >>
> >>
> >>--
> >>Oleg Paraschenko olpa@ http://xmlhack.ru/ XML news in Russian
> >>http://uucode.com/blog/ Generative Programming, XML, TeX, Scheme
> >>
> >>-----------------------------------------------------------------
> >>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> >>initiative of OASIS <http://www.oasis-open.org>
> >>
> >>The list archives are at http://lists.xml.org/archives/xml-dev/
> >>
> >>To subscribe or unsubscribe from this list use the subscription
> >>manager: <http://www.oasis-open.org/mlmanage/index.php>
> >>
> >
> >
> >
> > -----------------------------------------------------------------
> > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > initiative of OASIS <http://www.oasis-open.org>
> >
> > The list archives are at http://lists.xml.org/archives/xml-dev/
> >
> > To subscribe or unsubscribe from this list use the subscription
> > manager: <http://www.oasis-open.org/mlmanage/index.php>
> >
> >
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
--
Oleg Paraschenko olpa@ http://xmlhack.ru/ XML news in Russian
http://uucode.com/blog/ Generative Programming, XML, TeX, Scheme
|