473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

LINQ Question

How would I use LINQ to XML 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>

In other words, I'm only interested in:

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.

Thanks.
Jun 27 '08 #1
1 1006
On Jun 11, 10:44 pm, "Scott M." <s...@nospam.nospamwrote:
How would I use LINQ to XML 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/..."
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>

In other words, I'm only interested in:

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.

Thanks.
I'm just wondering if a standard XmlNode's InnerText would grab that
without much trouble. Or maybe a cleverly written XPath query?
Hopefully Martin or one of the other Xml gurus will stop by, but to me
it doesn't seem like LINQ is the right solution here.

Thanks,

Seth Rowe [MVP]
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Johnson | last post by:
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
4
by: BeSharp | last post by:
I recently stumbled across a pretty interesting LINQ to SQL question and wonder, whether anybody might have an answer. (I'm doing quite some increasing LINQ evangelism down here in Germany.). ...
1
by: shapper | last post by:
Hi, I wonder, is there some tool that transforms SQL procedures to LINQ? :-) I want to use LINQ but I have so much work done in SQL that would be great to transform my SQL code to LINQ. ...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
1
by: hrishy | last post by:
Hi Terry Oops i never realised the mistake i have commited I apologise (i thought changing the subject line would make a new thread) I apologise (I thought Python programmers were smart and...
4
by: CSharper | last post by:
I have following XML <root> <Person id="1"> <Name>a</Name> </Person> <Person id="2"> <Name>b</Name> </Person> </root>
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
4
by: George | last post by:
I am a bit conservative type and usually give some time for technology to mature before starting to try it. Today my question is Linq. To start using it or not. So here is the voting questions....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.