Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSL Sort

XSL Sort

Scheduled Pinned Locked Moved XML / XSL
algorithmsxml
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bbm2k3
    wrote on last edited by
    #1

    Hello all, I am rendering my page using XSL.At place I am using sorting using xsl sort.But this need to be dynamic i e user can sort by some specific fiend by his own choice. So I have to put select as dynamic which I am passing to xsl as a parameter as <code><xsl:param name="SortName" select="Name" /> <xsl:param name="SortDataType" select="text" /></code> Now I am accessing these parameter in xsl:sort tag as <code> <xsl:sort select="$SortName" data-type='{$SortDataType}'/></code> but its not working... Waiting for your reply..

    S 1 Reply Last reply
    0
    • B bbm2k3

      Hello all, I am rendering my page using XSL.At place I am using sorting using xsl sort.But this need to be dynamic i e user can sort by some specific fiend by his own choice. So I have to put select as dynamic which I am passing to xsl as a parameter as <code><xsl:param name="SortName" select="Name" /> <xsl:param name="SortDataType" select="text" /></code> Now I am accessing these parameter in xsl:sort tag as <code> <xsl:sort select="$SortName" data-type='{$SortDataType}'/></code> but its not working... Waiting for your reply..

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      If SortName is the name of an element, try something like this:

        <xsl:sort select="./\*\[name()=$SortName\]"/>
      

      [edit]Or if SortName is the name of an attribute, then use this:

        <xsl:sort select="./@\*\[name()=$SortName\]"/>
      

      [/edit]

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups