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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:52:50+00:00 2026-05-14T03:52:50+00:00

say there is an xml file, which not created by me, with a known

  • 0

say there is an xml file, which not created by me, with a known schema (for example, rss).

how would you parse it with C#? would you do that manually by XDocument etc, or would you use XMLSerializer and create a correspond class? or would you use Visual Studio tools to generate classes using a dtd file (that you’ll write).

what do you think the most aesthetic, easy, not error-prone way?

  • 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-14T03:52:50+00:00Added an answer on May 14, 2026 at 3:52 am

    In my opinion, the easiest method in terms of coding difficulty would be to generate an object model off of the schema, and use that with the XmlSerializer to go back and forth between objects and XML. There is a tool called xsd.exe that comes with Visual Studio that can generate code from xsd files.

    That said, if the schema is complex or written by a dinosaur, the object model will be ugly and hard to use. If your XML is archaic or poorly written/designed, sometimes it’s easier to just manipulate it directly using XmlDocument or XDocument. Out of those two, I’d prefer the newer LINQ to XML model (XDocument), because it’s easier to search the XML, and it’s easier to insert or manipulate elements/attributes/etc.

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

Sidebar

Related Questions

Just say I have a file configuration.xml that a php script needs to parse
Say there is some functionality needed for an application under development which could be
Say there is a css style declaration to an element which has been set
Say there is a dict variable that grows very large during runtime - up
Let's say there is a report to compare charges with adjustments that outputs to
I'm trying to read in an xml file which looks like this <?xml version=1.0
on my server i've got an xml file for each client which holds the
I'm currently re-writing a class which handles xml files. Depending on the xml file
If you have an XML schema which dictates an element has a default value,
I have a WCF application that at present is using XML based file storage

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.