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. XSLT - Trailing values

XSLT - Trailing values

Scheduled Pinned Locked Moved XML / XSL
xmlhelptutorialquestion
5 Posts 3 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.
  • T Offline
    T Offline
    Tristan Rhodes
    wrote on last edited by
    #1

    I have a set i want to enumerate through in an XSLT, of say, 3-4 values, and i'd like to comma seperate them except for the final one. i.e. i'd like new string[] {"John", "Ben", "Suzy"}; to be generated in the xslt into: "John, Ben, Suzy" Without the trailing comma after suzy, but i have no idea how to do this. Could anyone help? Cheers Tris

    ------------------------------- Carrier Bags - 21st Century Tumbleweed.

    L 1 Reply Last reply
    0
    • T Tristan Rhodes

      I have a set i want to enumerate through in an XSLT, of say, 3-4 values, and i'd like to comma seperate them except for the final one. i.e. i'd like new string[] {"John", "Ben", "Suzy"}; to be generated in the xslt into: "John, Ben, Suzy" Without the trailing comma after suzy, but i have no idea how to do this. Could anyone help? Cheers Tris

      ------------------------------- Carrier Bags - 21st Century Tumbleweed.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Try usin an if with something like not(last())

      led mike

      T 1 Reply Last reply
      0
      • L led mike

        Try usin an if with something like not(last())

        led mike

        T Offline
        T Offline
        Tristan Rhodes
        wrote on last edited by
        #3

        Fantastic, Cheers. Forgive me, i'm an Xslt noob using copy and paste :) T

        ------------------------------- Carrier Bags - 21st Century Tumbleweed.

        P 1 Reply Last reply
        0
        • T Tristan Rhodes

          Fantastic, Cheers. Forgive me, i'm an Xslt noob using copy and paste :) T

          ------------------------------- Carrier Bags - 21st Century Tumbleweed.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Buy a book. (Dang that sounds nastier than I want, I really mean it as a friendly suggestion.) When I started learning XSL I found my old XML Bible (circa 2001) was out of date, so I bought a new book; XSLT 1.0, O'Reilly and it really helped. And also http://www.w3schools.com/xsl/default.asp[^]

          T 1 Reply Last reply
          0
          • P PIEBALDconsult

            Buy a book. (Dang that sounds nastier than I want, I really mean it as a friendly suggestion.) When I started learning XSL I found my old XML Bible (circa 2001) was out of date, so I bought a new book; XSLT 1.0, O'Reilly and it really helped. And also http://www.w3schools.com/xsl/default.asp[^]

            T Offline
            T Offline
            Tristan Rhodes
            wrote on last edited by
            #5

            I find it easy enough to grasp, and i can figure it out in time. I just hate the whole process of doing tutorials and stuff that i already know just to get to those small gems of information that i actualy need to make it work. ;)

            ------------------------------- Carrier Bags - 21st Century Tumbleweed.

            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