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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:41:02+00:00 2026-06-14T04:41:02+00:00

Although the Title might not make sense (I had a hard time describing this

  • 0

Although the Title might not make sense (I had a hard time describing this problem to shortly) I will try to explain here.

I have some XML that contains some values that will always be there, but it also contains an undefined number of other variables, Such as this:

<fooElements>
    <fooElement>
        <name>fooElem1</name>
        <barElement>
            <name>foobarElem1</name>
        </barElement> //There's an undefined number of these bar elements.
    </fooElement>
</fooElements>

Is there anyway process those barElements with the fooElement class?

My first though was to place a list inside of the fooElement class and then load the barElement(s) into that, but when i then serialize it back i get:

<fooElements>
    <fooElement>
        <name>fooElem1</name>
        <barList>
            <barElement>
                <name>foobarElem1</name>
            </barElement> //There's an undefined number of these bar elements.
        <barList>
    </fooElement>
</fooElements>

Which is not what i am looking for.

Is there any way i can store this undefined number of barElements inside the fooElement class without it showing in the xml?

  • 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-14T04:41:03+00:00Added an answer on June 14, 2026 at 4:41 am

    Just make your barList an XmlElement. For example:

    [XmlElement("barElement")]
    public List<BarElementObject> BarElements { get; set; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title suggests, this isn't going to make any sense. Imagine the scenario:
This is not a duplicate of this post although the title is very similar.
Although the question title appears a bit subjective I am sure there is not
Although I have found some solutions to this problem, none of them refer to
Although this is completed successfully on completion, it is not having the desired update.
(The title may not be proper but I try my best to phrase it)
Although the question title is duplicate of many discussions, I did not find a
As per the question title. Although not required; I would like to stop people
Although this syntax does not render, this is basically what I am attempting to
This is one of the hardest questions I've ever had to title here on

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.