Solved

LINQ XML extract us ing VB.NET

Posted on 2009-04-06
3
405 Views
Last Modified: 2013-11-11
Hello,

I would like to extract the element named "Message" from the XML shown below.

Thank you
<soap:Envelope>
<soap:Body>
 <ProcessMessageResponse>
 <payload>
 <content id="Content0">
 <OrderUpdateResponse>
 <Success>
  <Message>Order successfully updated.</Message> 
  </Success>
  </OrderUpdateResponse>
  </content>
  </payload>
  </ProcessMessageResponse>
 </soap:Body>
</soap:Envelope>

Open in new window

0
Comment
Question by:MisterT25
  • 2
3 Comments
 
LVL 9

Expert Comment

by:Sreedhar Vengala
ID: 24082918
Try this:

from r in doc.Descendants("Message") select r;
0
 
LVL 9

Accepted Solution

by:
Sreedhar Vengala earned 500 total points
ID: 24082921
XElement doc = XElement.Load("C:\\abc.xml");
IEnumerable<XElement> elements = from r in doc.Descendants("Message") select r;
0
 

Author Closing Comment

by:MisterT25
ID: 31567304
That worked perfectly.  Thank you for your quick reponse.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question