Subject: RE: Requirements for XSLT 1.1 (rtf/node set to boolean coercion) From: "Evan Lenz" <elenz@xxxxxxxxxxx> Date: Tue, 29 Aug 2000 10:09:24 -0700 |
What Mike Kay said a couple weeks ago: <quote> I wrongly suggested in my book (sorry, Microsoft) that the implicit coercion had a side-effect in causing the conversion of a result tree fragment to a boolean to give the wrong answer. In fact converting a result tree fragment to a boolean should always give the answer "true", and it was Saxon that was wrong in returning the result of boolean(string($rtf)) </quote> Evan Lenz elenz@xxxxxxxxxxx http://www.xyzfind.com XYZFind Corp. "Building Better Search" -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of David Carlisle Sent: Tuesday, August 29, 2000 7:44 AM To: xsl-list@xxxxxxxxxxxxxxxx Cc: xsl-editors@xxxxxx Subject: Requirements for XSLT 1.1 (rtf/node set to boolean coercion) Looks good! One question/comment on result tree fragment/node set unification. The new requirements document is worded so as to imply that the only difference between rtf and node-set is the restriction of the allowed operators. I had thought that the other difference was coercion to boolean, non-empty node sets always being true but non-empty rtf being false if they have empty string value. However perhaps my (and saxon's?) reading of the spec was faulty. The xslt spec states that operations are allowed on rtf if they would also be allowed on a string, but (I now see) it doesn't explicitly state that the operation on the rtf actually proceeds by first coercing to the string value of the rtf. Given the stylesheet at the end of this message, applied to itself, xt and xalan give <?xml version="1.0" encoding="utf-8"?> a: b: true c: d: true === wheras saxon gives what I had previously thought to be the more correct result, <?xml version="1.0" encoding="utf-8" ?> a: b: true c: d: === with $d being taken as false as it has empty string value. If the node set/rtf distinction is to be dropped (which would be a good thing:-) while maintaining the requirement that error free XSLT 1.0 stylesheets MUST not have their behaviour changed, then the saxon (5.3.2) interpretation is incorrect, or this behaviour is being classed as not "fully specified" in XSLT 1.0. Would it be possible to clarify this in the eventual 1.1 release, David <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output method="xml" indent="yes"/> <!-- empty node set --> <xsl:variable name="a" select="document('')/aaa"/> <!-- non empty node set (string value empty string) --> <xsl:variable name="b" select="document('')/*/xsl:output"/> <!-- empty string --> <xsl:variable name="c"/> <!-- non empty rtf with (string value empty string) --> <xsl:variable name="d"> <x/> </xsl:variable> <xsl:template match="/"> a: <xsl:if test="$a">true</xsl:if> b: <xsl:if test="$b">true</xsl:if> c: <xsl:if test="$c">true</xsl:if> d: <xsl:if test="$d">true</xsl:if> === </xsl:template> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Requirements for XSLT 1.1 (rtf/node, David Carlisle | Thread | Re: Requirements for XSLT 1.1 (rtf/, Gary L Peskin |
Re: XML _TO_ Spreadsheet??, John Robert Gardner | Date | RE: two-toned background...., Dickson, Dan |
Month |