Re: [xml] Ambiguity regarding schema content and schema validation
- From: "Pete Cordell" <petexmldev tech-know-ware com>
- To: <nageshs huawei com>, <xml gnome org>
- Cc: ashutosh_p huawei com, ranjit huawei com
- Subject: Re: [xml] Ambiguity regarding schema content and schema validation
- Date: Sat, 5 Jan 2008 17:07:07 -0000
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" <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
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/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]