locked
How to get the List of child nodes from xml to xsl to display in HTML RRS feed

  • Question

  • User-832642931 posted

    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

    Sunday, January 20, 2013 6:49 AM

Answers

  • User1070236303 posted

    You nedd to add a nested xsl:for-each for STATE_ID_C

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 20, 2013 11:22 AM