Re: [xml] Ambiguity regarding schema content and schema validation

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="";).

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.


Pete Cordell
Visit for XML C++ data binding
----- Original Message ----- From: "Nagesh" <nageshs huawei com>
To: <xml gnome org>
Cc: <ashutosh_p huawei com>; <ranjit huawei com>
Sent: Saturday, January 05, 2008 4:19 PM
Subject: [xml] Ambiguity regarding schema content and schema validation

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,


xml mailing list, project page
xml gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]