According to VS2005 (and I agree with it) 1.xsd is not a valid schema. You can have multiple elements with the same name in the same complex type, but those elements have to have the same type.
Also, I think you need to make the URIs contained in the values of your xmlns:tns and targetNamespace attributes the same (probably xmlns:tns="http://abc.com"). Even if 1.xsd were valid, I'm not sure why either 2.xml or 3.xml might pass validation as there should be a minimum requirement for two b elements. HTH, Pete Cordell Codalogic Visit http://www.codalogic.com/lmx/ for XML C++ data binding ----- Original Message ----- From: "Nagesh" <[EMAIL PROTECTED]> To: <[email protected]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 05, 2008 4:19 PM Subject: [xml] Ambiguity regarding schema content and schema validation > Hello, > I am using libxml version 28. I have a query regarding parsing of > the schema file and as well as schema validation. > Is the attached schema (1.xsd) syntactically correct, (It is having > more than 1 element with the same name, in the complex definition). If it > is > correct; instance document (2.xml) is success but whereas the instance > document (3.xml) is returning failure for schema validation using > xmlSchemaValidateDoc( ). > But for schema file, 4.xsd; in which I have interchanged the > datatype definitions, (xs:int with xs:string and vice-versa), it returns > success for both instance document 2.xml and 3.xml. > Any leads will be appreciated. Thanks in advance for the reply. > > Thanks and Regards, > Nagesh. > -------------------------------------------------------------------------------- > _______________________________________________ > xml mailing list, project page http://xmlsoft.org/ > [email protected] > http://mail.gnome.org/mailman/listinfo/xml > _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
