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) > 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
<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) > 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