Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] xsl:sort with nulls at end

From: "Rebecca Sapir" <rsapir@-------------------->
To:
Date: 11/3/2008 5:56:00 PM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent