xsl:sort select bug?

January 12, 2006

After pulling at hair for nearly two hours, i have reached the conclusion that there is a bug in the mozilla XSLT engine (and in the opera engine as well (Maybe they are both the same). The bottom line is that you cannot asign a value for the select attribute in xsl:sort via parameters (param).

      <xsl:apply-templates select="title">
             <xsl:sort order='{$myOrder}' select='{$myColumn}'/>
      </xsl:apply-templates>

It should work but it does not. (Obviously myColumn and myOrder have been defined as parameters elsewhere on the sheet.

So you might think that it would not be possible to change the sort column dynamically, turns out that you can do it with javascript (or to use that more popular (and much hyped term) javascript).

	sortTag = xslStylesheet.getElementsByTagName('sort');
	sortTag.item(0).setAttribute('select',columnName);

Didn't yet try this with PHP, should.

Posted by raditha at January 12, 2006 5:33 PM
Your Ad Here

 

Jabber  |  Linux  |  mySQL  |  PHP  |  Java  |  Site Map  |  Wiki

Downloads  |  About  |  Links  |  Contact  |  Home

 

Copyright © Raditha Dissanayake 2003 - 2007

Terms of Use  |  Privacy

 

 

January 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31