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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:38:18+00:00 2026-06-11T01:38:18+00:00

This is the xml i get back from a third part api : <data>

  • 0

This is the xml i get back from a third part api :

<data>
    <installations>
        <installation>
            <reader>1</reader>
            <reader>2</reader>
            <reader>3</reader>
            <reader>4</reader>
        </installation>
    </installations
</data>

And these are the classes I have for now

public class data
{
    public List<installation> installations
}

public class installation
{
    // HERE I DON'T KNOW HOW TO DO THE <reader> STUFF
}

I hope someone knows how this should be done

/Martin

  • 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-11T01:38:20+00:00Added an answer on June 11, 2026 at 1:38 am

    Your classes could look like this:

    public class data
    {
        public List<installation> installations { get; set; }
        public data() { installations = new List<installation>(); }
    }
    
    public class installation
    {
        [XmlElement("reader")]
        public List<reader> reader { get; set; }
        public installation() { reader = new List<reader>(); }
    }
    
    public class reader
    {
        [XmlTextAttribute]
        public Int32 value {get;set;}
    }
    

    Two things are important here:

    1. the use of XmlElement("reader") to hide the <reader></ reader> nodes that would otherwise created due to the List<reader> reader property.

    2. the use of XmlTextAttribute to have the the <reader><value>1</value></reader> created as <reader>1</reader>.

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

Sidebar

Related Questions

I'm working with XML data from an application where we get XML like this:
i get my pagedata from an xml and i want this data to be
How can I get java classes from an xml file? In this situation, I
For example i have this xml. I need to get value of parameter val
I have to send an XML request to recover data from a remote server
I've been asked to create an app that will get data back from a
I'm using SimpleXML to get pieces of data from an XML web-service response. We
I am trying to get a xml document back from the webserver that also
I'm trying to get a list of names back from this - but it's
For my application, I make an HTTPRequest, and get back some XML served from

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.