|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] IF-ELSE.. Sorting
<xsl:for-each select="LIST/ASSIGN">
* Hi, I am trying to do a conditional sort. I want to have a look at an
input parameter $arrangeby and if this is of Type DATE then I would like to
specify a sorting different from my usual
<xsl:sort select="*[name()=$arrangeby]"/>
as now I want to specify the data-type as "number" and then also break it
up into
substring-before and substring-after, I will want to specify a different
<xsl:sort>, so
I assumed I would use <xsl:if test="$arrangeby = 'DATE'"> and put in my xsl
code and finish it off
with </xsl:if>.
To start off with, quite basically, I need to know precisely how the
if-else syntax works. Hehhe, just cant find an If-Else example.
Secondly if I use this basic IF check...
<xsl:for-each select="LIST/ASSIGN">
<xsl:if test="$arrangeby = 'TSDATE'">
<xsl:message>
Hello
</xsl:message>
</xsl:if>
<xsl:sort select="*[name()=$arrangeby]"/>
I get the error "Keyword xsl:sort may not be used here. "
The <xsl:if>..</xsl:if> block works fine when place just before the
<xsl:for-each> block.
**finally got my XSLT book, so hopefully I will ask less daft questions in
the future. Thanks for all those that have managed to just "grin and bare"
my simple questions so far ;)
Karlo
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








