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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:42:23+00:00 2026-05-26T07:42:23+00:00

I have a question about Microsoft’s MSDN documentation for the Extenstions.GetSchemaInfo Method (XElement) for

  • 0

I have a question about Microsoft’s MSDN documentation for the Extenstions.GetSchemaInfo Method (XElement) for .Net framework 4.0.

I want to know if there’s a way from within the

Private Sub DumpInvalidNodes(ByVal el As XElement)
   If el.GetSchemaInfo.Validity <> XmlSchemaValidity.Valid Then
     ...
   End If
End Sub

Code to get the ValidationEventArgs.Message for the invalid node. This example works fine when you have numbered XML nodes like in the example: GrandChild1, GrandChild2. You can tell which invalid node is producing the validation errors by site. But when you have XML without numbered nodes, e.g.

<Root>
    <Child>
        <GrandChild>AAA</GrandChild>
        <GrandChild>ZZZ</GrandChild>
        <GrandChild>ZZZ</GrandChild>
    </Child>
</Root>

you get output that looks like this:

(1)Validating doc1 ... 
(2)The 'GrandChild' element is invalid - The value 'ZZZ' is invalid according to its datatype 'GCType' - The Enumeration constraint failed. 
(3)The 'GrandChild' element is invalid - The value 'ZZZ' is invalid according to its datatype 'GCType' - The Enumeration constraint failed. 
(4)doc1 did not validate 
(5)Invalid Element /Root 
(6)Invalid Element /Root/Child 
(7)Invalid Element /Root/Child/GrandChild 
(8)Invalid Element /Root/Child/GrandChild 

I wanted a way to tell that line (7) referred to the ErrorMessage in line (2).

I have an XML document that I’m running XSD validation against as this article shows and I wanted to parse the ValidationEventArgs.Message into a more user friendly message for complex data types. I’d like to do this in the DumpInvalidNodes() method because I have access to the invalid Node and can obtain other information from the node (like an ID) that the user can use to find and fix the validation problem.

  • 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-26T07:42:24+00:00Added an answer on May 26, 2026 at 7:42 am

    The easiest way for you would be to modify the original code and instead of doing the node dumping after, do it in the validation handler; it’ll give you the validation message and the node at the same time (simply cast the sender to an XObject and deal with it as you need).

    For XML loaded from files or strings you could also use this MSDN article here. Additional hints to the user, such as line number and column position, could also be useful.

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

Sidebar

Related Questions

I have a theoretical question about the .net framework. As I see it Microsoft
I have a very basic question about the LocalMon print monitor found at http://msdn.microsoft.com/en-us/library/windows/hardware/ff556478%28v=vs.85%29.aspx
I have a question about support for DEVPATH ( http://msdn.microsoft.com/en-us/library/cskzh7h6.aspx ) in the future.
I have a question about Entity Framework. Please answer if you know answer on
I have a question about using streams in .NET to load files from disk.
I have a question about the returnUrl querystring parameter that is appended by ASP.Net
I have a question about aspnet_applications table I have created asp.net membership using .net
I have a couple of questions about transactions in WF4... According to this http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/aeab2bcd-26c6-49be-8e08-d65ee2688038
I have a general question about using ADO together with SQL-server 2008express (Microsoft). When
I have a question about Microsoft SQL Server 2005. How can I delete or

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.