Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 20, 2013 03:22 PM by stmarti
None
0 Points
14 Posts
Jan 20, 2013 10:49 AM|LINK
Hi friends,
I have XML like as below form:
<PARENT>
<ROOT>
<LAST_NAME_C>First</LAST_NAME_C>
<FIRST_NAME_C>Last</FIRST_NAME_C>
<STATE_ID_C>NM</STATE_ID_C>
<STATE_ID_C>ML</STATE_ID_C>
<STATE_ID_C>KL</STATE_ID_C>
</ROOT>
</PARENT>
------------------------------------
I have written the XSL like as below to display the Last Name, First Name and all state's in HTML format:
<xsl:for-each select="PARENT/ROOT"> <tr> <td width="30%"> <xsl:value-of select="LAST_NAME_C"></xsl:value-of>, <xsl:value-of select="FIRST_NAME_C"></xsl:value-of> </td> <td width="30%"> <xsl:value-of select="STATE_ID_C"></xsl:value-of> </td> </tr> </xsl:for-each>
I Expected output like as below:
Name State
Last Name, First Name NM
Last Name, First Name ML
Last Name, First Name KL
But Output is showing like as below:
The remaining two states are not displaying on the list.
Please adive to proceed on this.
Thanks,
Prem
Contributor
4963 Points
1036 Posts
Jan 20, 2013 03:22 PM|LINK
You nedd to add a nested xsl:for-each for STATE_ID_C
premmiley
None
0 Points
14 Posts
How to get the List of child nodes from xml to xsl to display in HTML
Jan 20, 2013 10:49 AM|LINK
Hi friends,
I have XML like as below form:
<PARENT>
<ROOT>
<LAST_NAME_C>First</LAST_NAME_C>
<FIRST_NAME_C>Last</FIRST_NAME_C>
<STATE_ID_C>NM</STATE_ID_C>
<STATE_ID_C>ML</STATE_ID_C>
<STATE_ID_C>KL</STATE_ID_C>
</ROOT>
</PARENT>
------------------------------------
I have written the XSL like as below to display the Last Name, First Name and all state's in HTML format:
<xsl:for-each select="PARENT/ROOT">
<tr>
<td width="30%">
<xsl:value-of select="LAST_NAME_C"></xsl:value-of>, <xsl:value-of select="FIRST_NAME_C"></xsl:value-of>
</td>
<td width="30%">
<xsl:value-of select="STATE_ID_C"></xsl:value-of>
</td>
</tr>
</xsl:for-each>
I Expected output like as below:
Name State
Last Name, First Name NM
Last Name, First Name ML
Last Name, First Name KL
But Output is showing like as below:
Name State
Last Name, First Name NM
The remaining two states are not displaying on the list.
Please adive to proceed on this.
Thanks,
Prem
stmarti
Contributor
4963 Points
1036 Posts
Re: How to get the List of child nodes from xml to xsl to display in HTML
Jan 20, 2013 03:22 PM|LINK
You nedd to add a nested xsl:for-each for STATE_ID_C