xsl-list
[Top] [All Lists]

[xsl] If/then/else confusion

2012-12-25 13:19:31
Hello,
I am trying to modify a sort-select statement I worked out a very long time ago. In the original, I wanted not to sort by a <Prefix> if it were an 'A' and this code does just that:

<xsl:sort select="if( Prefix!='A' ) then Prefix else ''"/>

I am not sure why its positive version does not work:
<xsl:sort select="if( Prefix='A' ) then '' else Prefix"/>

However, my new task is to not sort by (1) <Prefix> if the prefix is 'A' or, (2) if the <CatalogName> contains 'SG'.

In the positive the statement look is:

<xsl:sort select="if( Prefix='A' or contains(CatalogName, 'SG')) then '' else Prefix"/>

That statement somehow works for the second filter, [the contains], but not the first [the prefix='A'].

I have no idea what is going on and would appreciate any help I can get.
Thanks,
Merry Christmas,
Mark




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--