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

  • Home
  • SEARCH
  • 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 8653743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:36:58+00:00 2026-06-12T14:36:58+00:00

I haven’t found any information on this, maybe someone could help. I have an

  • 0

I haven’t found any information on this, maybe someone could help.

I have an XML (simplified for convenience):

<content>
  <field1>value</field1>
  <field2>
    <field3>value</field3>
  </field2>
</content>

I try to deserialize it using such classes:

[XmlRoot("content")]
public class Content
{
    [XmlElement]
    public List<Item> Fields { get; set; }
}

public class Item
{

    [XmlElement]
    public List<Item> Fields { get; set; }

    [XmlText]
    public String Value { get; set; }
}

I have two questions:

  1. Can I get the actual name of the field? Like [XmlName] string name; in the Item class? Or some kind of an attribute for the class itself? It is not possible to set the node name to “field” and add “type” attribute, for some reasons 😉 While the actual class and serialization process is really complicated, I’d prefer not to implement my own serializer.

  2. Can I add a wildcard like [XmlElement(“field*”)]? I can’t test it until I know the answer to the first question, so if there is a better option, I’d love to know it as well.

Thanks.

  • 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-12T14:36:59+00:00Added an answer on June 12, 2026 at 2:36 pm

    The only answer here is that it’s, unfortunately, not possible.

    As a result we have written our own serialization routine.

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

Sidebar

Related Questions

I haven't found information about this anywhere. Is there a minimal required length for
Haven't seen this before so hopefully someone has a easy solve, I have a
Haven't found a solution to this problem yet, have tried some things... I have
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I haven't found a definite answer to this yet. Lots of apps let you
This could be a duplicate question, but I have no idea what search terms
Haven't found this in my search on Stackoverflow - I know I've seen a
Haven't found anything useful about this on the internet. I'm using my Windows 7
I haven't found any get equivalent to appendBytes. If I've understood getBytes correctly, that
Haven't seen many Geneva related questions yet, I have posted this question in the

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.