This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

arbitrary sorting (part II)


Hey, after submitting my mail I got an idea - and - it works!! :-))

For those of you who are interested:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:m ="urn:non-null-namespace">

<m:month name="Jan" value="1" />
<m:month name="Feb" value="2" />
<m:month name="Mar" value="3" />
<m:month name="Apr" value="4" />
<m:month name="May" value="5" />
<m:month name="Jun" value="6" />
<m:month name="Jul" value="7" />
<m:month name="Aug" value="8" />
<m:month name="Sep" value="9" />
<m:month name="Oct" value="10" />
<m:month name="Nov" value="11" />
<m:month name="Dec" value="12" />

<xsl:template match="report-list">
   <xsl:apply-templates>
      <xsl:sort select="document('')//m:month[@name=current()/@month]/@value" 
                data-type="number" />
   </xsl:apply-templates>
</xsl:template>

</xsl:stylesheet>


BTW: My test suite yields:
- XT and LotusXSL/Xalan 1.0.1   ok
- Saxon 5.3.2                   failed  (Mike K., are you listening?)
- Oracle 2.0.2.8                XSLException 
  (XSL-1008: Namespace prefix 'm' used but not declared.)


Best regards,
Oliver



/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@informatik.hu-berlin.de             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]