Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:10:34+00:00 2026-06-08T12:10:34+00:00

i need to xml file repeated item. Inside item i have fields like title,

  • 0

i need to xml file repeated item. Inside “item” i have fields like title, pubdate, description, dc:creator and with repeatwp:comment… see the xml file below..

<channel>
    <item>
        <title>What Messed With My Head: Summit 2011</title>
        <link>http://www.wcablog.com/2011/08/what-messed-with-my-head-summit-2011/</link>
        <pubDate>Fri, 26 Aug 2011 09:10:04 +0000</pubDate>
        <dc:creator>willowcreekassociation</dc:creator>
        <guid isPermaLink="false">http://www.wcablog.com/?p=1706</guid>
        <description></description>
        <content:encoded>
            <![CDATA[text here]]>
        </content:encoded>
        <wp:comment>
            <wp:comment_id>1016</wp:comment_id>
            <wp:comment_author><![CDATA[]]></wp:comment_author>
            <wp:comment_author_email>thelmabowlen@gmail.com</wp:comment_author_email>
            <wp:comment_author_url></wp:comment_author_url>
            <wp:comment_author_IP></wp:comment_author_IP>
            <wp:comment_date>2011-08-26 20:13:00</wp:comment_date>
            <wp:comment_content><![CDATA[some text ]]></wp:comment_content>
        </wp:comment>
        <wp:comment>
            <wp:comment_id>1016</wp:comment_id>
            <wp:comment_author><![CDATA[]]></wp:comment_author>
            <wp:comment_author_email>thelmabowlen@gmail.com</wp:comment_author_email>
            <wp:comment_author_url></wp:comment_author_url>
            <wp:comment_author_IP></wp:comment_author_IP>
            <wp:comment_date>2011-08-26 20:13:00</wp:comment_date>
            <wp:comment_content><![CDATA[some text ]]></wp:comment_content>
        </wp:comment>
    </item>
    <item>
        <title>What Messed With My Head: Summit 2011</title>
        <link>http://www.wcablog.com/2011/08/what-messed-with-my-head-summit-2011/</link>
        <pubDate>Fri, 26 Aug 2011 09:10:04 +0000</pubDate>
        <dc:creator>willowcreekassociation</dc:creator>
        <guid isPermaLink="false">http://www.wcablog.com/?p=1706</guid>
        <description></description>
        <content:encoded>
            <![CDATA[text here]]>
        </content:encoded>
    </item>
    <item>
        <title>What Messed With My Head: Summit 2011</title>
        <link>http://www.wcablog.com/2011/08/what-messed-with-my-head-summit-2011/</link>
        <pubDate>Fri, 26 Aug 2011 09:10:04 +0000</pubDate>
        <dc:creator>willowcreekassociation</dc:creator>
        <guid isPermaLink="false">http://www.wcablog.com/?p=1706</guid>
        <description></description>
        <content:encoded>
            <![CDATA[text here]]>
        </content:encoded>
        <wp:comment></wp:comment>
        <wp:comment></wp:comment>
    </item>
</channel>

I am using following code to read xml..

XDocument xDoc = XDocument.Load("willowcreekassociationblog.wordpress.xml");

        var list = xDoc.Descendants("Occurrence")
        .Select(o => new List.XMLList
        {
            title = (string)o.Element("title"),
            URL = (string)o.Element("link"),
            Descr = (string)o.Element("Description"),
            StartDate = (DateTime)o.Element("pubdate"),
        })
        .ToList();

But i dont know how read the wp:comment with my above code…can anyone help me how to do this??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:10:35+00:00Added an answer on June 8, 2026 at 12:10 pm

    You haven’t said what you want to do with the data, which makes the question hard to answer. You also haven’t shown where the wp namespace alias is defined, but hey…

    You want something like this, within your Select call:

    Comments = o.Elements(wp + "comment")
                .Select(comment => Comment.FromXElement(comment))
                .ToList();
    

    I find it helpful to give static methods within the domain objects which can perform the transformation from XElement – it keeps things clearer.

    FromXElement would then be something like:

    public static Comment FromXElement(XElement x)
    {
        return new Comment((int) x.Element(wp + "comment_id"),
                           (string) x.Element(wp + "author"),
                           ...);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml file which I need to open with Microsoft Word 2007.
I have an xml file I need to modify: ... </web-app> I want to
I have an XML file and I need to extract testname from all the
need help to read xml file. i have one xml file which i want
I need to read an XML file on a low memory system (don't have
i have a xml file on a server that look for example like this
I have an xml file generated dynamically through a php code section.I need this
I need to read XML file and store all the info inside variables/class when
My XML file does not have repeated info (e.g. Feed xml file). I just
I have a xml file having 50 different questions and i need only 15

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.