Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple for-each processing?

Status
Not open for further replies.

gabstero

Programmer
Oct 5, 2011
2
US
Hi knowledgeable Folks!

New kid on the block here. I have trouble processing an XML 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>

What am I doing wrong?

Thanks!
Gabstero
 
Have you actually tried this? What is your output?

Tom Morrison
Micro Focus
 
Thanks for the feedback. I did - I am only getting the 1st <COLUMN> item displayed.

thanks,
Gabstero
 
Okay. Now try this:
Code:
<xsl:for-each select="COLUMN_HEADERS/COLUMN">
<td><xsl:value-of select="."/></td>
</xsl:for-each>

This is similar to this example.

Tom Morrison
Micro Focus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top