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

xsl:sort with nulls at end

Subject: xsl:sort with nulls at end
From: "Rebecca Sapir" <rsapir@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Nov 2008 12:55:56 -0500
 xsl:sort with nulls at end
Saxon parser
Xslt 2

I am sorting XML using xsl:sort. It looks something like this.

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
   <xsl:template match="REPORT">
      <xsl:copy>
         <xsl:for-each select="*">
            <xsl:sort select="X" order="ascending" data-type="text"/>
            <xsl:sort select="Y" order="descending" data-type="text"/>
            <xsl:sort select="Z" order="ascending" data-type="number"/>
            <xsl:copy-of select="."/>
         </xsl:for-each>
      </xsl:copy>
   </xsl:template>
   <xsl:template match="*">
      <xsl:copy>
         <xsl:apply-templates/>
      </xsl:copy>
   </xsl:template>
</xsl:transform>

The issue I have is that if the row is missing that tag, the sort puts
that record first. Ie. Nulls come first. I need the nulls to come last.
Is there a way to get around this and force the nulls to be last?

Thanks,
Rebecca


--------------------------------------------------------------------------
This message contains information from Merlin Securities, LLC, or from one of
its affiliates, that may be confidential and privileged. If you are not an
intended recipient, please refrain from any disclosure, copying, distribution
or use of this information and note that such actions are prohibited. If you
have received this transmission in error, please notify the sender immediately
by telephone or by replying to this transmission.

Merlin Securities, LLC is a registered broker-dealer. Services offered through
Merlin Securities, LLC are not insured by the FDIC or any other Federal
Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC
and may lose value. Nothing in this communication shall constitute a
solicitation or recommendation to buy or sell a particular security.

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.