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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:33:29+00:00 2026-05-27T23:33:29+00:00

I want to validate large xml files by using xsd schemas in C#. For

  • 0

I want to validate large xml files by using xsd schemas in C#.
For a file of 1000 lines of xml code validation takes a long time.

Are there any tips and tricks to validate faster?

Can you post some code examples that work faster with large xml validation?

Edit 1 : I validate like this
Validating XML with XSD

Edit 2: For large files takes more than 10 seconds. And I need the validation to be very fast under a second.

Edit 3: File size is greater than 10 Mb

Edit 4: I am considering this approach too, I want to store xml file in database and xsd too.

  • 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-27T23:33:30+00:00Added an answer on May 27, 2026 at 11:33 pm

    You are currently loading the entire document into memory, which is expensive regardless of validation. A better option is to just parse via a reader, i.e. as shown here on MSDN. The key points from the example on that page:

    • it never loads the entire document
    • the while(reader.Reader()) just enumerates the entire file at the node level
    • validation is enabled via the XmlReaderSettings
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to validate xml against xsd file. So I would like to install
I want to validate an XML file against an XML Schema file. It is
I want to be able to validate a large quantity of files (a couple
I want to read a fairly large xml file. Its small enough to fit
I want to validate below data using regex and python. Below is the dump
I want to validate a text box that doesn't accept any special characters using
I want validate HTML code in Java. Like this: HTMLValidator.validateHTML(aaa<b>bbb<b>); // Returns false, because
I want to validate a file name Name of file or folder should not
I want to write a Powershell script that will validate a large number of
I'm using the jQuery Validation plugin and trying to validate two time fields. I

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.