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

Order of nodes in a union

Subject: Order of nodes in a union
From: Nick Browne <NickBrowne@xxxxxxxxxxxxxxx>
Date: Fri, 30 Jun 2000 11:59:17 +0100
xsl variable nodes union
I have a union of two node sets which orders the elements in document
order. However, I had expected to see the first set in the union first,
followed by the second set, for example :

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
 <xsl:template match="/">
  <dummy>
 <xsl:variable name="P" select="//Purchase"/>
 <xsl:variable name="Q" select="//Quantity"/>
 <xsl:variable name="values" select="$P | $Q"/>
  <xsl:for-each select="$values">
   <xsl:value-of select="name()"/>
  </xsl:for-each>
 </dummy>
 </xsl:template>
</xsl:stylesheet>

with :

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Root>
 <Range Number="1" Total="15.00">
  <Purchase>3.00</Purchase>
  <Quantity>5</Quantity>
 </Range>
 <Range Number="2" Total="17.50">
  <Purchase>2.50</Purchase>
  <Quantity>7</Quantity>
 </Range>
 <Range Number="3" Total="13.50">
  <Purchase>4.50</Purchase>
  <Quantity>3</Quantity>
 </Range>
</Root>

This displayed :

'PurchaseQuantityPurchaseQuantityPurchaseQuantity'

whereas I had expected to see the 3 Purchase elements followed by the 3
Quantity elements.

Is this normal behaviour for the union operator, I couldn't see anything
in the spec that indicated what ordering should be used ? This was run
on Oracle v2.0.2.8.

--
Nick Browne
Slipstone Ltd


 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.