LINQ Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott M.

    #1

    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.c om/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.


  • rowe_newsgroups

    #2
    Re: LINQ Question

    On Jun 11, 10:44 pm, "Scott M." <s...@nospam.no spamwrote:
    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.c om/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]

    Comment

    Working...