Solved

LINQ XML extract us ing VB.NET

Posted on 2009-04-06
3
403 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now