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
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="/">
 <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()"/>

with :

<?xml version="1.0" encoding="ISO-8859-1" ?>
 <Range Number="1" Total="15.00">
 <Range Number="2" Total="17.50">
 <Range Number="3" Total="13.50">

This displayed :


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