Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - LINQ to XML >Thread Next - Re: LINQ to XML Re: LINQ to XMLTo: NULL Date: 6/12/2008 1:20:00 PM
Scott M. wrote:
> How would I use LINQ to XML (vb .net) to extract just the text (not the
> markup) of the following:
>
> <description><![CDATA[<p><a
> href="http://www.msnbc.msn.com/id/25085248/"><img align="left" border="0"
> src="http://msnbcmedia.msn.com/j/msnbc/Components/ArtAndPhoto-Fronts/TECH/080610/g-080610-tec-tencent-4x3-10a.thumb.jpg"
> alt="" style="margin:0 5px 5px 0" /></a>In an interview, David Hajdu, author
> of the book "The Ten-Cent Plague: The Great Comic-Book Scare and How it
> Changed America," discusses the rise and fall of the rise and fall of
> comics, and how their unwelcome reception compares to today's criticism of
> violent video games.</p><br clear="all" />]]></description>
Here is how you can do it, using Joe's suggestion:
XElement desc = XElement.Load(@"file.xml");
XElement data = XElement.Parse("<data>" + desc.Value +
"</data>");
Console.WriteLine(data.Value);
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
