RE: [xsl] Re: XPath incompatibilities

Subject: RE: [xsl] Re: XPath incompatibilities
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 2 Jan 2002 09:43:52 -0000
> Miloslav Nic wrote:
> > ========================================
> > 2. The rules for converting a string to a boolean have changed, so
> > they are now aligned with XML Schema. In XPath 2.0, the strings "0"
> > and "false" are treated as false, while in XPath 1.0, they were
> > treated as true. All other strings are converted in the same way as
> > XPath 1.0.
> > ----------------------------------------
> >
> > I would prefer the 1.0 way. It is a rule which can become dangerous
> > doing text processing.
>
> [Jeni Tennison agreed] that it's dangerous when doing text processing,
certainly if
> test whether there's any remaining string in the normal way
> (test="$string"). If this change were made, we would need to change
> all those recursive string manipulation algorithms so that they used
> test="string-length($string)" instead, or something similar.
>

I'm sure we'll review this one again, but I wouldn't like to guess what the
outcome would be. There is still work underway on exactly how schemaless
documents fit into the type system, which has a bearing on this question.
Meanwhile I'd suggest everyone gets into the habit of writing
   test="$string != ''"
which is unambiguous.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread