You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by everett stauffer <ev...@chem.ucsd.edu> on 2000/07/27 08:38:41 UTC

How to use param as xsl:sort select value?

Hello folks-

Using: RH 6.2, Apache 1.3.12, IBM Java 1.3, Tomcat 3.1, Xalan 1.2D01

Have used processor.setStylesheetParam(key, val) successfully to pass
a param to a stylesheet.

  processor.setStylesheetParam("sortkey", processor.createXObject("COL2"));

  <xsl:param name="sortkey" select="COL1"/>

can easily use it to do things like:
  <xsl:choose>
    <xsl:when test="name(.) = $sortkey">
      ...display the column header differently...
    </xsl:when>
    <xsl:otherwise>
      ...display the column header in standard way...
    </xsl:otherwise>
  </xsl:choose>

Want to use that param within a sort statement:
  <xsl:sort select="$sortkey"/>

This iss 'accepted' (generates no errors) by Xalan, but the sort
doesn't occur.

On the other hand, using
  <xsl:sort select="COL1"/>
works exactly as I expect.

Grabbed Xalan1.2 thinking that nodeset extension might do the
trick...but nodeset tells me that I'm passing in a String,
and not a result-frag.

What do I need to do to make the use of a param in a sort work?


Thanks,


Everett