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:for-each question

xsl:for-each question

Scheduled Pinned Locked Moved XML / XSL
xmlquestionhelptutorial
3 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.
  • D Offline
    D Offline
    Dewald
    wrote on last edited by
    #1

    Hi all, I hope someone can help. I'm new to XSL so this might be pretty straight forward. I have a section of XML that looks something like this: <PhysicalAddr> <Line>Physical line 1</Line> <Line>Physical line 2</Line> <Line>Physical line 3</Line> </PhysicalAddr> I'm trying to transform this with <xsl:for-each select="Line"> but seeing as the tags have no children tags, I'm not sure how to return the contents of each by using the <xsl:value-of select="???"> element. In other words, what do I replace the ??? with? Am I making my question clear enough and could anyone help perhaps?

    G 1 Reply Last reply
    0
    • D Dewald

      Hi all, I hope someone can help. I'm new to XSL so this might be pretty straight forward. I have a section of XML that looks something like this: <PhysicalAddr> <Line>Physical line 1</Line> <Line>Physical line 2</Line> <Line>Physical line 3</Line> </PhysicalAddr> I'm trying to transform this with <xsl:for-each select="Line"> but seeing as the tags have no children tags, I'm not sure how to return the contents of each by using the <xsl:value-of select="???"> element. In other words, what do I replace the ??? with? Am I making my question clear enough and could anyone help perhaps?

      G Offline
      G Offline
      George L Jackson
      wrote on last edited by
      #2

      You use a period:

      <xsl:value-of select="."/>

      "We make a living by what we get, we make a life by what we give." --Winston Churchill

      D 1 Reply Last reply
      0
      • G George L Jackson

        You use a period:

        <xsl:value-of select="."/>

        "We make a living by what we get, we make a life by what we give." --Winston Churchill

        D Offline
        D Offline
        Dewald
        wrote on last edited by
        #3

        Brilliant, thanks!

        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