Solved

LINQ XML extract us ing VB.NET

Posted on 2009-04-06
3
410 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What are the simplest ways to create a Merge Sort? 3 37
Open a link in vb.net 2 26
ModalPopup  question 22 38
Web page design problem 3 16
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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