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 version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:tns="http://huawei.com"; targetNamespace="http://abc.com"; elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="a">
		<xs:choice>
			<xs:element name="b" type="xs:int"/>
			<xs:sequence>
				<xs:element name="b" type="xs:string"/>
			</xs:sequence>
		</xs:choice>
	</xs:complexType>
	<xs:element name="root" type="tns:a"/>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:tns="http://huawei.com"; targetNamespace="http://abc.com"; elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="a">
		<xs:choice>
			<xs:element name="b" type="xs:string"/>
			<xs:sequence>
				<xs:element name="b" type="xs:int"/>
			</xs:sequence>
		</xs:choice>
	</xs:complexType>
	<xs:element name="root" type="tns:a"/>
</xs:schema>
<root xmlns="http://abc.com";><b>xyz</b></root>
<root xmlns="http://abc.com";><b>123</b></root>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to