.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

XML schema validation issue

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :.NET Framework
In case a particular node is mandatory, the error described is for the next sibling. In case there exists a error for the next sibling as well. That error message is supressed. On resolving the first issue, and running the validation again, the second error is thrown. Is there a way we can set options on the schema validation, so that we can receive both errors at the same time. For example we have a xml with the following nodes <NM101></NM101> <NM102></NM102> <NM103></NM103> Here NM101 is a mandatory node and NM102 has type as integer. In case we receivethe below xml <NM102>ABC</NM102> <NM103>DEF</NM103> Error: The element 'NM1' has invalid child element 'NM102'. List of possible elements expected: 'NM101' But the error for NM102 is now supressed and can be retrieved only when NM101 is present. Is there a way that all errors can be reported at the same time ?Swapnil Kasodekar

View Complete Post

More Related Resource Links

User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


Web Services: Extend the ASP.NET WebMethod Framework by Adding XML Schema Validation


WebMethods make the development of XML Web Services easier by encapsulating a good deal of functionality, but there is still a lot of underlying XML processing that you have to be responsible for. For example, WebMethods do not validate messages against the implied schema. Because they are not validated, the response that's returned can result in unintended consequences. To address this, the authors extend the WebMethod framework by adding XML Schema validation through a custom SoapExtension class.

Aaron Skonnard and Dan Sullivan

MSDN Magazine July 2003

XmlReader.Create(textReader, XmlReaderSettings) Validation Issue

For the most part, when I perform an XmlReader.Read() I am catching validation errors based on my schemas.  This, however, is a large group of schemas with several imports and includes.  My question is why I'm having validation errors in two places that seem to be defined in the schema.   Here's an example:   Schema 1 (you can see that IdentificationType has sub-elements for IdentificationID and IdentificationCode):   <xsd:complexType name="IdentificationType">                 <xsd:annotation>                         <xsd:documentation>A data type for a representation of an identity.</xsd:documentation>                         <xsd:appinfo>                                 <i:Base i:namespace="http://niem.gov/niem/structures/2.0" i:name="Object"/>               &nb

VS2010 Schema Compare Issue

I’m using VS2010 Schema Compare to compare two databases – let’s call them ‘DB1’ and ‘DB2’. I want DB1 to have its schema altered to match DB2. I select DB2 as the source and DB1 as the target, and compare. When I hit the Write Updates button, I am getting the following error: SQL01268: .Net SqlClient Data Provider: Msg 1834, Level 16, State 1, Line 1 The file ‘c:Program FilesMicrosoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\DB1.mdf’ cannot be overwritten. It is being used by database ‘DB1’. Why is Schema Compare trying to create a new DB? And, more to the point, why is it trying to create a DB named the same as the Source? Can anyone give me a workarround here? Thanks in advance.

how to skip schema validation?

Hello All, I wrote below XML schema to validate below XML, In schema I do not include below element <Emp_ID></Emp_ID>  <Name></Name>, the reason is I do not want to validate what are the child element under <Attributes>..mean to say I only want to validate <Header> part of XML. what need to do with schema so that the checking of <Attributes> can be skiped...is there any way..please help me?? DECLARE @x XML(TestSchema) SELECT @x = '<PDI_Approval_Message> <Header> <SourceSystem Value="WF" Name="Workforce"></SourceSystem> <TransactionType Value="WF_TS" Name="WFSheet"></TransactionType> <RequestType Value="Submit" Name="Action"></RequestType> <SubmittedOn Value="06/10/2010" Name="SumbmitedOn"></SubmittedOn> <SubmittedBy Value="pdi/vmuser3" Name="hannok"></SubmittedBy> </Header> <Transactions> <Transaction> <Attributes> <Emp_ID>75867</Emp_ID> <Name>AYZA</Name> </Attributes> </Transaction> </PDI_Approval_Message>' CREATE XML SCHEMA COLLECTION TestSchema AS'<?xml version="1.0" ?> <xsd:schema attributeFormDefault="unqualified" elementFormDef

need to add 2 more validation in XML Schema

I have below XML Schema Collection, --DROP XML SCHEMA COLLECTION [dbo].[AS_MetaDataRegistry_Schema] CREATE XML SCHEMA COLLECTION [dbo].[AS_MetaDataRegistry_Schema] AS N'<?xml version="1.0" encoding="utf-16"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="PDI_Approval_MetaData"> <xs:complexType> <xs:sequence> <xs:element name="Header"> <xs:complexType> <xs:sequence> <xs:element name="SourceSystem"> <xs:complexType> <xs:attribute name="Value" type="xs:string" use="required" /> <xs:attribute name="Name" type="xs:string" use="required" /> </xs:complexType> </xs:element> <xs:element name="TransactionType"> <xs:complexType> <xs:attribute name="Value" type="xs:string" use="required" /> <xs:attribute name="Name" type="xs:string" use="required" /> </xs:complexType> </xs:element> <xs:element name="TransactionVersion"> &l

Issue with validation using IDataErrorInfo with int range

Hi, I have a textbox which takes only numbers as input. Textbox has binding with int type property. <TextBox Name="TXT_From" Text="{Binding Path=Range, UpdateSourceTrigger=LostFocus,<br/>  ValidatesOnDataErrors=True, Mode=TwoWay}" /> public int Range { get { return (int)GetValue(RangeFromProperty); } set { SetValue(RangeFromProperty, value); } } public static readonly DependencyProperty RangeFromProperty = DependencyProperty.Register("Range", typeof(int), typeof(MyClass)); In IDataErrorInfo I am doing some auto correction of values. public string this[string property] { get { string msg = null; switch (property) { case "Range": if (Range < 0) Range = 1; if (Range > Max) Range = TempMax; break; default: throw new ArgumentException("Unrecognized property: " + property); } return msg; } } Now the issue is when I enter value greater than 2,147,483,647 which is max value for int the IDataErrorInfo member public string this[string property] is not getting called,also it displays red bordered textbox. I want to avoid this validation and dont want restriction on value input. How to achieve this?  

MultiView issue with validation in form


Hi all,

Currently I am working on a user control which has the following "layout":

  • the user control elements are placed inside an Update Panel
  • inside the Update Panel I have a MultiView control with 4 views:
    • first view 2 buttons to select the type of the user to create (clicking one button changes the active view to the second view, clicking the other one activates the third view)
    • second view is for the form used to create a user type
    • third view is for the form used to create the other user type
    • forth view should be used to display the confirmation message for the creation of both user types

In both forms, besides he usual textboxes I am also using validation controls to make sure the data the user inputs is correct.

However, I have a problem in case the data is invalid (the user doesn't input some mandatory field): for a very short period of time I see the * next to the mandatory field and the error in the validation summary, but immediately the active view is switched back to the first view in the MultiView control.

How can I force the control to stay on the view with the selected form?

Any ideas, suggestions or comments are welcomed!

Thank you in advance!


Catch 22 Database Connection Validation Issue w/ BIDS and Production Server


I have a rather simple SSIS package that exports data through an ODBC connection from an IBM iSeries database and copies that data to a SQL Server 2005 database.  When I was designing the application, I was able to connect to the iSeries database and store the user ID and password with my BIDS project and copy the data with out any problems.  Great!

When I finished designing and testing the project, I loaded it to the production server.  The final test was to schedule the process so that it would run each night.  I didn't realize it at the time but the password that I had stored with the project in BIDS was removed from the package and various MS documentation stated that I should create a configuration file and load the password from there.  So, I made the necessary changes to the project, adding a configuration file.  The config file is in the Miscellaneous folder within the BIDS project, however, it isn't automatically copied to the bin directory when I build the project.  I have to manually save it to the server, and then after importing the project I have to manually link to the necessary config fields.

This fixed the problem with the server, however, now I can not get BIDS to save my password with the connection string from within the designer.  This is a huge problem.  I am exporting from 21 different da

Security Validation / Silverlight issue?

When Security Validation is turned off on a 2010 web application, the Silverlight menus break in that web app.  Why is that?  I've seen it across many farms, so I know it's an issue.

Help regarding Schema validation using C#


Hi All,

I am validating an xml markup against a schema using a XmlReader object. To find validation warnings i am passing a schemavalidation settings object. How do I find the elements that are causing the validation errors and their value that is causing the validation errors.

exploring the validationargs object, i found a variable holding the element that caused the error. But the problem is,it is a non public member of ValidationEventArgs.Exception.

How do I get that info??

MVC 3 Beta - PasswordFor Validation Issue


I have been working with MVC 3 Beta, and things are off to a very good start.

However, I discovered that PasswordFor() is not emitting unobtrusive validation.  I worked around it for now by using TextBoxFor(), and adding type = "password" to the attributes for the textbox.  This gives me a password field, and my unobtrusive validation is emitted.

Is this the correct forum to report MVC 3 Beta issues?



Metadata buddy class validation issue


I accidentally duplicated the thread and I found no way to delete one of them.

Please, follow the thread here: http://forums.asp.net/t/1614475.aspx




I am using asp.net MVC 2 and Entity Framework 4. I followed the directions to annotate my model classes through a buddy metadata class, so annotations are not lost when EF classes are generated.

It worked fine for a simple class, but now I am working on a more complex class, that requires regular expression and range validation for double type values.

It seems that for this class, MVC is finding the annotation to display the label (I changed the annotation and I saw it changed on my browser), but as far as the validation annotations, it is ignoring it completely.

Any idea before I try something crazy, like downloading the mvc source, and debugging the framework myself?



Input-validation-Error issue when Model has complex types



I have implemented aps.net mvc validation and it is working fine. Only issue I have "Input-validation-error" css class is not getting applied if model has complex types.

I am using my own data annotations for validation.

Any idea how to resolve  this.



Validation script in list schema



Anyone knows what the script tag in the validation element is good for? Do we put javascript here?

<Field ID="" Name="FieldName">
        <Validation Message="Message" Script="What's in here???"></Validation>

Active Directory Issue : Validation fails for newusers and few randon users


Hi All,

We started observing this behaviour from past couple of days. Even the AD Validation fails for the newly created users. So there are few users for whom the Active Directory authentication fails. We are not sure why it is happening. The code and configuration is not a problem since the same code works for other environment which has different domains. Has some one seen this kind of behaviour before. Infact we had a service to authenticate users so initial culprit was the service but now we have minimize the problem domain to AD. I created a simple application which JUST VALIDATES the user against the AD but still the same problem.  I am getting very generic error which does not seem to help in debugging.

Any help will be highly appreciated.

Event Type:   Information

Event Source: ASP.NET 2.0.50727.0

Event Category:       Web Event

Event ID:       1315

Date:            4/5/2011

Time:            3:35:42 PM

User:            N/A

Computer:     TRNMCS001


Event code: 4006

Event message: Membership credential verifi

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend