How to access <string> nodes

Discussion in 'XML' started by kumarforu, Apr 6, 2010.

  1. kumarforu

    kumarforu

    Joined:
    Apr 6, 2010
    Messages:
    2
    I Used XML Serializer for SubEligBenInfo object using C# and have the following XML.

    <SubEligBenInfo>
    <sName>Name</sName>
    <sMessage>
    <string>string 1</string>
    <string>string 2</string>
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    <string xsi:nil="true" />
    </sMessage>

    </SubEligBenInfo>

    I am trying to print the values of sMessage using the following in XSLT
    <xsl:for-each select="sMessage/string">
    <xsl:choose>
    <xsl:when test="string-length(sMessage/string) &gt; 0">
    Message:<xsl:value-of select="sMessage/string"/><br/>
    </xsl:when>
    <xsl: otherwise></xsl: otherwise>
    </xsl:choose>
    </xsl:for-each>

    But not able to get the Messages on HTML output. Please help me.
    Final Output should be like this
    Message: String 1
    Message: String 2
    kumarforu, Apr 6, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    429
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    500
    gavnosis
    Aug 2, 2003
  3. Timo Nentwig

    selecting nodes between other nodes

    Timo Nentwig, Jun 16, 2004, in forum: XML
    Replies:
    1
    Views:
    395
    Patrick TJ McPhee
    Jun 17, 2004
  4. Johnny Ooi

    Looking A Nodes From Within Nodes

    Johnny Ooi, Nov 13, 2004, in forum: XML
    Replies:
    10
    Views:
    647
    Johnny Ooi
    Nov 14, 2004
  5. mlybarger@gmail.com

    finding nodes that don't match other nodes

    mlybarger@gmail.com, Jan 27, 2005, in forum: XML
    Replies:
    2
    Views:
    382
Loading...

Share This Page