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

empty sequence as complex content

Subject: empty sequence as complex content
From: "David Carlisle d.p.carlisle@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Jul 2019 17:01:33 -0000
 empty sequence as complex content
The following stylesheet generates a variable x using a sequence
constructor that evaluates to an empty sequence...

<xsl:stylesheet version="3.0"

 <xsl:variable name="x">
  <xsl:sequence select="()"/>

 <xsl:template match="/">
  <xsl:message select="'C1:',
               $x instance of xs:string,
  <xsl:message select="'C2:',
               $x instance of document-node(),
               $x/node() instance of text(),


$x is a variable that is a document node with a text node child the
text node having zero length.

I just read https://www.w3.org/TR/xslt-30/#constructing-complex-content
10 times but still don't see where the text node came from

having the xsl:sequence there means it avoids the XSLT 1 special case
returning a string, and not having an as= attribute means there is an
implicit  document node generated, but I would expected that $x was
just a document node with no children, but saxon (Saxon-HE

$ saxon9 ev.xsl ev.xsl
C1: false 0
C2: true 1 true 0
<?xml version="1.0" encoding="UTF-8"?>

If someone could point me at the right bit of the spec I think I'm
missing a step somewhere...


Current Thread


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.
First Name
Last Name
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.