This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Problems with sort.
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Problems with sort.
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Mon, 12 Jun 2000 16:11:21 +0100
- Reply-To: xsl-list at mulberrytech dot com
> That worked, but there is one more aspect of it that I need
> to figure out.
> Some of the sort keys the user can select are text, and some
> are numeric.
> Some how I need to toggle back and forth (data-type). I was
> thinking I could
> have setup a global variable and set it according to if
> statements, like if
> /PAGE/@sort is "project number" then set the global variable
> to number.
>
> What I'm not sure is:
>
> a) Where in an XSL document would you put the if statements
> to setup the global variable?
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="/PAGE/@sort='project_number'>number</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:variable>
> b) How would I put the value of the global variable into the data-type
> attribute of the sort? Would I use the same command you gave
> me for the select attribute?
<xsl:sort data-type="{type}"/>
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list