[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Requirements for XSLT 1.1 (rtf/node set to boolean coercion)

Subject: Requirements for XSLT 1.1 (rtf/node set to boolean coercion)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 29 Aug 2000 14:43:50 GMT
xsl boolean operators variable
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.