Topic
  • 1 reply
  • Latest Post - ‏2011-10-08T05:43:39Z by SystemAdmin
gabster
gabster
4 Posts

Pinned topic Trouble Accessing Childs with for-each

‏2011-10-06T19:37:21Z |
Hi All

New kid on the block here. I have trouble processing an XML (via a xsl file) that looks like this:
<COLUMN_HEADERS>
<COLUMN>DATE</COLUMN>
<COLUMN>ICD-9 CODE</COLUMN>
<COLUMN>PROC CODE</COLUMN>
<COLUMN>DESCRIPTION</COLUMN>
<COLUMN>AMOUNT></COLUMN>

with a for-each statement that looks like this:

<table>
<tr>
<xsl:for-each select="COLUMN_HEADERS">
<td><xsl:value-of select="COLUMN"/></td>
</xsl:for-each>
</tr>
</table>

I am only getting the first <COLUMN> child element.

What am I doing wrong?

Thanks!
Gabstero
Updated on 2011-10-08T05:43:39Z at 2011-10-08T05:43:39Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1130 Posts

    Re: Trouble Accessing Childs with for-each

    ‏2011-10-08T05:43:39Z  
    Like this.
    
    <xsl:for-each select=
    "COLUMN_HEADERS/COLUMN"> <td><xsl:value-of select=
    "."/></td> </xsl:for-each>