title: XSLT: Sorting like SOLR
body: <p>I am using an XSLT to sort a piece of XML such as:</p>
  
  <pre><code>&lt;feed&gt;
     &lt;entry&gt;
        &lt;title&gt;A To Z&lt;/title&gt;
     &lt;/entry&gt;
     &lt;entry&gt;
        &lt;title&gt;Action&lt;/title&gt;
     &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>The XSLT looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" 
   xmlns:atom="http://www.w3.org/2005/Atom"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
   &lt;xsl:param name="name" select="'title'" /&gt;
   &lt;xsl:param name="order" select="'ascending'" /&gt;
  
   &lt;xsl:output method="xml" encoding="UTF-8" indent="yes" /&gt;
  
   &lt;xsl:template match="@* | node()"&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select="@* | node()" /&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  
   &lt;xsl:template match="atom:feed"&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select="/atom:feed/*[not(self::atom:entry)]" /&gt;
     &lt;xsl:apply-templates select="/atom:feed/atom:entry"&gt;
      &lt;xsl:sort select="*[name() = $name]" order="{$order}" /&gt;
      &lt;xsl:sort select="atom:id" data-type="number" /&gt;
     &lt;/xsl:apply-templates&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I expect the values to come out in an order such as A To Z, then Action, but the result contains the opposite. It would look like the whitespace is being ignored as a value to sort by.</p>