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 6802193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:11:37+00:00 2026-05-26T19:11:37+00:00

I have some XML: <messages> <message> <meta appid=1112 date=20111028 msgid=4498016 msgno=855 permlinkdate=2011-10-28> <summary>RedBook is

  • 0

I have some XML:

<messages>
    <message>
        <meta appid="1112" date="20111028" msgid="4498016" msgno="855" permlinkdate="2011-10-28">
            <summary>RedBook is a fun book</summary>
        </meta>
        <ISBN>1234123412123</ISBN>
    </message>
    <message>
        <meta appid="1112" date="20111028" msgid="4498016" msgno="855" permlinkdate="2007-1-30">
            <summary>BlueBook is a good book</summary>
        </meta>
        <ISBN>123412341234</ISBN>
    </message>
</messages>

And I have some Linq to XML to operate on this XML:

public static List<ReviewDTC> GetReviews()
{
    XElement xmlDoc = XElement.Load(@"C:\Users\inelson\Desktop\fiddle.xml");

    var dtos = from item in xmlDoc.Descendants("message")
               select new ReviewDTC()
               {
                   PubDate = item.Element("meta").Attribute("permlinkdate").Value,
                   Summary = item.Element("summary").Value,
                   Isbn = item.Element("ISBN").Value
               };

    List<ReviewDTC> reviews = new List<ReviewDTC>();
    reviews = dtos.ToList();

    return reviews;
}

The purpose of the above code is to parse the document for each message node, and for each message node, create an object with that node’s child elements (and one attribute). Each object is added to a collection and so on..

When debugging this code, I place a BP after var dtos = and it is asserting that dtos is not being set to an instance of an object when it is instantiating a new ReviewDTC object. Is the parser not able to read from Meta, Summary or ISBN to build the object? Whats going on?

I appreciate it, big time.

  • 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-05-26T19:11:38+00:00Added an answer on May 26, 2026 at 7:11 pm

    The summary element is under the meta element.

    Try this:

    Summary = item.Element("meta").Element("summary").Value,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some set of xml generated via xmlserialization of some WCF messages. Now
We have some standalone devices that will send XML messages to arbitrary processing software
I have this bit of XML <status complete=false> <messages> <message>Message 1</message> <message>Message 2</message> <message>Message
We have a Message broker application in Java which accepts messages(XML). It validates the
I have some XML that is structured like this: <whatson> <productions> <production> <category>Film</category> </production>
I have some XML files that contain different function information. I am trying to
I have some XML which contains records and sub records, like this: <data> <record
I have some XML which I'm trying to search: <debts> <section id=24 description=YYYYY> <section
I have some xml like this: <Data> <Rows> <Row> <Field Name=title>Mr</Field> <Field Name=surname>Doe</Field> <Row>
I have some xml data contained in three files (Database.xml, Participants.xml, and ConditionTokens.xml). I

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.