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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:27:28+00:00 2026-05-30T21:27:28+00:00

i am trying to parse this xml file into an object to use the

  • 0

i am trying to parse this xml file into an object to use the information it gathers. I am attaching an example of the xml. The XDocument fills with the xml information but it is not able to get the information i am wanting. Can someone help me, i’m new to this?

Edit- Just because you don’t see a field that i am looking for doesn’t mean it doesn’t exist. I double checked all values, they do exist, the Bill object is very large so i only put a portion of it.

Example xml

<results>


<count type="integer">13683</count>
  <bills type="array">
    <bill>
      <abbreviated type="boolean">false</abbreviated>
      <actions type="array">
        <action>
          <type>vote</type>
          <acted_at type="datetime">2010-12-22T12:00:00Z</acted_at>
          <text>Introduced in the Senate, read twice, considered, read the third time, and passed without amendment by Unanimous Consent.</text>
        </action>
        <action>
          <type>action</type>
          <acted_at type="datetime">2010-12-22T12:00:00Z</acted_at>
          <text>Message on Senate action sent to the House.</text>
        </action>
        <action>
          <type>action</type>
          <acted_at type="datetime">2010-12-22T21:05:00Z</acted_at>
          <text>Received in the House.</text>
        </action>
        <action>
          <type>action</type>
          <acted_at type="datetime">2010-12-22T22:10:00Z</acted_at>
          <text>Held at the desk.</text>
        </action>
      </actions>
      <awaiting_signature type="boolean">false</awaiting_signature>
      <bill_id>s4053-111</bill_id>
      <bill_type>s</bill_type>
      <chamber>senate</chamber>
      <code>s4053</code>
      <committees></committees>
      <cosponsor_ids type="array">
        <cosponsor_id>S000663</cosponsor_id>
      </cosponsor_ids>

My code (I have tried both “bill” and “bills” as the descendant.)

var tutorials = from tutorial in xmlDoc.Descendants("bills")
                            select new
                            {
                                SponsorID = tutorial.Element("sponsor_id").Value,
                                SponsorFirstName = tutorial.Element("sponsor").Element("first_name").Value,
                                SponsorLastName = tutorial.Element("sponsor").Element("last_name").Value,
                                LastActionText = tutorial.Element("last_action").Element("text").Value,
                                BillNumber = tutorial.Element("number").Value,
                                BillType = tutorial.Element("bill_type").Value,
                                Enacted = tutorial.Element("enacted").Value,
                                EnactedDateTime = tutorial.Element("enacted_at").Value,
                                CongressSession = tutorial.Element("session").Value,
                                HousePassageResult = tutorial.Element("house_passage_result").Value,
                                HousePassageDateTime = tutorial.Element("house_passage_result_at").Value,
                                SenatePassageResult = tutorial.Element("senate_passage_result").Value,
                                SenatePassageDateTime = tutorial.Element("senate_passage_result_at").Value,
                                ShortTitle = tutorial.Element("short_title").Value,
                            };
  • 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-30T21:27:30+00:00Added an answer on May 30, 2026 at 9:27 pm

    There is neither a sponsor_id nor a sponsor or a first_name element in your Xml (and so on), so basically your Xml is completely different from what your code expects – this cannot work, regardless of “bill” and “bills”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am beginner in PHP. I am trying to parse this xml file. <relationship>
Trying to parse some XML but apparently this is too much for a lazy
I have this XML file that I parse into its elements and create a
I'm trying to parse the contents of an remote XML file into MySQL, so
ok so I am trying to parse XML data into a table, this is
While trying to parse an xml file into table format, jQuery keeps closing my
I'm trying to parse a massive xml file into my MySQL database. the file
I'm trying parse an xml file and insert it into an mysql database. The
I'm trying to parse the DMOZ content/structures XML files into MySQL, but all existing
I am currently trying to parse some xml data into an NSDictionary . This

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.