Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to access <string> nodes

Reply
Thread Tools

How to access <string> nodes

 
 
kumarforu kumarforu is offline
Junior Member
Join Date: Apr 2010
Posts: 2
 
      04-06-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Text nodes and element nodes query asd Java 3 05-23-2005 10:01 AM
Looking A Nodes From Within Nodes Johnny Ooi XML 10 11-14-2004 06:55 PM
selecting nodes between other nodes Timo Nentwig XML 1 06-17-2004 04:54 AM
Reality check: Is it sensible to link XML nodes to other XML nodes in the same file? gavnosis XML 0 08-02-2003 08:22 AM



Advertisments