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

RE: behavior of xsl:value-of with empty string

Subject: RE: behavior of xsl:value-of with empty string
From: "Dion Houston" <dionh@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Oct 2002 11:31:15 -0700
anita sood microsoft
Lars:

Thank you for discovering an issue with our products.  I've confirmed
that this issue is present in all current versions of our XSLT parsers
(MSXML3 and 4; System.Xml)

As you have discovered, a text node is being created, albeit with empty
content.  This is contrary to XSLT spec 7.6.1.

I have forwarded this information to the System.Xml and MSXML teams, and
they have filed bugs to have this fixed.  I'll track this issue
personally, so if you would like me to update you when they're resolved,
please contact me directly.

Thank you for using Microsoft products!

Dion Houston
Software Design Engineer/Test, UDDI
http://uddi.microsoft.com

-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@xxxxxxxxxxxx] 
Sent: Tuesday, October 01, 2002 8:56 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  behavior of xsl:value-of with empty string

> The XSLT spec says that the xsl:value-of element creates a 
> text node in the result tree, but if the string is empty, no 
> text node should be created.  I have a situation where a rtf 
> is initially bound to a variable, then converted to a nodeset 
> using an extension function and I am, thus, able to detect 
> the processor's (lack of) adherence to this rule.  And I 
> believe msxml may not be following the spec.  Can someone, 
> please, confirm my suspicion or correct my misunderstanding?

The specification of msxsl:node-set() is entirely under Microsoft's
control.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> 
> If I run the stylesheet below, I get the following output:
> 
> test id=1: count(child::node())=1, expected 0
> test id=2: count(child::node())=0, expected 0
> test id=3: count(child::node())=3, expected 1
> test id=4: count(child::node())=2, expected 1
> test id=5: count(child::node())=2, expected 1
> test id=6: count(child::node())=1, expected 1
> test id=7: count(child::node())=1, expected 1
> test id=8: count(child::node())=1, expected 1
> test id=9: count(child::node())=3, expected 2
> 
> whereas I had expected to get:
> 
> test id=1: count(child::node())=0, expected 0
> test id=2: count(child::node())=0, expected 0
> test id=3: count(child::node())=1, expected 1
> test id=4: count(child::node())=1, expected 1
> test id=5: count(child::node())=1, expected 1
> test id=6: count(child::node())=1, expected 1
> test id=7: count(child::node())=1, expected 1
> test id=8: count(child::node())=1, expected 1
> test id=9: count(child::node())=2, expected 2
> 
> Lars
> 
> 
> <?xml version="1.0"?>
> <xsl:transform version="1.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>    exclude-result-prefixes="msxsl">
> 
> <xsl:template match="/">
>    <xsl:variable name="tests-rtf">
>       <tests>
>          <test id="1" children="0"><xsl:value-of select="''"/></test>
>          <test id="2" children="0"><xsl:value-of 
> select="''"/><xsl:value-of select="''"/></test>
>          <test id="3" children="1"><xsl:value-of 
> select="''"/><element/><xsl:value-of select="''"/></test>
> 
>          <test id="4" children="1"><xsl:value-of 
> select="''"/><xsl:value-of 
> select="''"/><element/><xsl:value-of select="''"/></test>
>          <test id="5" children="1"><xsl:value-of 
> select="''"/><element/><xsl:value-of 
> select="''"/><xsl:value-of select="''"/></test>
>          <test id="6" children="1"><xsl:value-of 
> select="''"/><xsl:value-of 
> select="''"/><element/><xsl:value-of 
> select="''"/><xsl:value-of select="''"/></test>
> 
>          <test id="7" children="1"><xsl:value-of 
> select="'1'"/><xsl:value-of select="''"/></test>
>          <test id="8" children="1"><xsl:value-of 
> select="'1'"/><xsl:value-of select="''"/><xsl:value-of 
> select="''"/></test>
>          <test id="9" children="2"><xsl:value-of 
> select="'1'"/><xsl:value-of 
> select="''"/><element/><xsl:value-of select="''"/></test>
>       </tests>
>    </xsl:variable>
> 
>    <xsl:for-each select="msxsl:node-set($tests-rtf)/tests/test">
>       test id=<xsl:value-of select="@id"/>: 
> count(child::node())=<xsl:value-of 
> select="count(child::node())"/>, expected <xsl:value-of 
> select="@children"/><br/>
>    </xsl:for-each>
> </xsl:template>
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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

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-2013 All Rights Reserved.