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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:19:31+00:00 2026-05-11T11:19:31+00:00

I have a schema, and I have a document. I want to allow insertion

  • 0

I have a schema, and I have a document. I want to allow insertion of an xml fragment into that document, but, it must be valid according to the schema.

Is it possible to do this in C#?

  • 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. 2026-05-11T11:19:31+00:00Added an answer on May 11, 2026 at 11:19 am

    I’ve never done this before, but you could use the NodeChanged, NodeInserted and NodeRemoved events of the XmlDocument (see http://msdn.microsoft.com/en-us/library/system.xml.xmldocument_events.aspx). When the event is raised, you could re-validate the document. If the validation fails, you could then un-change, remove, or re-insert the node.

    You may also be able to use the XmlSchemaValidator class, that that would be more complicated. It follows a push-based model, and, during validation, basically tells you what would be valid at the current point. I suppose you could validate down to the point of insertion, then check to see of the node to be inserted would be valid at that point. I’ve only used this to generate XML documents conforming to a schema set, however; I’ve never used it for just plain validation.

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

Sidebar

Ask A Question

Stats

  • Questions 109k
  • Answers 109k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you start multiple instances of java from the command… May 11, 2026 at 9:20 pm
  • Editorial Team
    Editorial Team added an answer Create one more nesting level: select Sum(VisitingCount)as VisitingCount, [Time] from… May 11, 2026 at 9:20 pm
  • Editorial Team
    Editorial Team added an answer If you have a huge Collection you're going to hit… May 11, 2026 at 9:20 pm

Related Questions

I've been looking at this issue for too long. I suspect I'm missing something
I have a requirement to build 'versioning' into an application and was wondering how
Essentially I want to embed some XHTML in an XML document that must validate
I have a custom XML schema defined for page display that puts elements on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.