[xml] Validate SCHEMA



Hi Everyone,

I have a schema and wanted to validate my xml against the XSD. But it 
gives an error. When I validate the same schema with XSV it validates 
correct. Is there any bug in the schema library.

The schema file and the data file is below this mail.

Thanks
Vikrant
------schema details---------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Vikrant 
(NA) -->
<!--W3C Schema generated by XMLSPY v2004 rel. 3 U 
(http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
        <xs:element name="action_calendar_data_exchange">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element ref="item" 
maxOccurs="unbounded"/>
                        </xs:sequence>
                        <xs:attribute name="file_timestamp" 
type="xs:dateTime" use="required"/>
                </xs:complexType>
        </xs:element>
        <xs:element name="action_id" nillable="false">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="add_date1" type="xs:date" nillable="true"/>
        <xs:element name="add_date2" type="xs:date" nillable="true"/>
        <xs:element name="add_info1">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="add_info2">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="add_info3">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="200"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="allow_update_record">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="1"/>
                                <xs:minLength value="1"/>
                                <xs:enumeration value="Y"/>
                                <xs:enumeration value="N"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="colour">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="colour_code">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="4"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="customer_code">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="description">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="error_code">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="error_message">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="1000"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="factory_name">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="import_status">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="1"/>
                                <xs:enumeration value="Y"/>
                                <xs:enumeration value="N"/>
                                <xs:enumeration value=""/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="item">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element ref="warning_error"/>
                                <xs:element ref="error_code"/>
                                <xs:element ref="error_message"/>
                                <xs:element ref="import_status"/>
                                <xs:element ref="action_id"/>
                                <xs:element ref="allow_update_record"/>
                                <xs:element ref="job_id"/>
                                <xs:element ref="customer_code"/>
                                <xs:element ref="style"/>
                                <xs:element ref="ship_date"/>
                                <xs:element ref="vendor_name"/>
                                <xs:element ref="factory_name"/>
                                <xs:element ref="ship_mode"/>
                                <xs:element ref="template_name"/>
                                <xs:element ref="style_status"/>
                                <xs:element ref="milestone_id"/>
                                <xs:element ref="milestone_name"/>
                                <xs:element ref="task_item"/>
                                <xs:element ref="colour_code"/>
                                <xs:element ref="colour"/>
                                <xs:element ref="description"/>
                                <xs:element ref="item_due_date"/>
                                <xs:element ref="item_revised_date"/>
                                <xs:element ref="item_arrival_date"/>
                                <xs:element 
ref="logon_original_plan_date"/>
                                <xs:element ref="review_plan_date"/>
                                <xs:element ref="logon_plan_date"/>
                                <xs:element ref="logon_actual_date"/>
                                <xs:element ref="milestone_status"/>
                                <xs:element 
ref="logon_action_item_remarks"/>
                                <xs:element ref="logon_cust_no"/>
                                <xs:element ref="logon_style_no"/>
                                <xs:element ref="logon_delivery"/>
                                <xs:element ref="logon_vend_no"/>
                                <xs:element ref="logon_fact_code"/>
                                <xs:element ref="logon_ship_mode"/>
                                <xs:element ref="logon_actn_id"/>
                                <xs:element 
ref="logon_action_item_code"/>
                                <xs:element ref="logon_subitem_name"/>
                                <xs:element ref="add_info1"/>
                                <xs:element ref="add_info2"/>
                                <xs:element ref="add_info3"/>
                                <xs:element ref="add_date1"/>
                                <xs:element ref="add_date2"/>
                        </xs:sequence>
                        <xs:attribute name="rownum" type="xs:long" 
use="required"/>
                </xs:complexType>
        </xs:element>
        <xs:element name="item_arrival_date" type="xs:date" 
nillable="true"/>
        <xs:element name="item_due_date" type="xs:date" nillable="true"/>
        <xs:element name="item_revised_date" type="xs:date" 
nillable="true"/>
        <xs:element name="job_id">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_action_item_code" nillable="false">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_action_item_remarks">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="200"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_actn_id">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_actual_date" type="xs:date" 
nillable="true"/>
        <xs:element name="logon_cust_no" nillable="false">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_delivery" type="xs:date" nillable="true"/>
        <xs:element name="logon_fact_code">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_original_plan_date" type="xs:date" 
nillable="true"/>
        <xs:element name="logon_plan_date" type="xs:date" 
nillable="true"/>
        <xs:element name="logon_ship_mode">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_style_no" nillable="false">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_subitem_name">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="200"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="logon_vend_no">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="milestone_id" nillable="false">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="milestone_name">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="milestone_status">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="review_plan_date" type="xs:date" 
nillable="true"/>
        <xs:element name="ship_date" type="xs:date" nillable="true"/>
        <xs:element name="ship_mode">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="style">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                                <xs:minLength value="1"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="style_status">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="20"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="task_item">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="template_name">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="vendor_name">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="80"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
        <xs:element name="warning_error">
                <xs:simpleType>
                        <xs:restriction base="xs:string">
                                <xs:maxLength value="1"/>
                                <xs:enumeration value="E"/>
                                <xs:enumeration value="W"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>
</xs:schema>
----------------------------------end of schema-------------------------------------------

-----------------------xml start-----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Vikrant 
(NA) -->
<action_calendar_data_exchange file_timestamp="2004-01-01T00:00:00" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="ActionCalendar.xsd">
        <item rownum="1">
                <warning_error>E</warning_error>
                <error_code>55555</error_code>
                <error_message>c</error_message>
                <import_status>Y</import_status>
                <action_id>c</action_id>
                <allow_update_record>Y</allow_update_record>
                <job_id>c</job_id>
                <customer_code>c</customer_code>
                <style>c</style>
                <ship_date>2004-01-01</ship_date>
                <vendor_name>c</vendor_name>
                <factory_name>c</factory_name>
                <ship_mode>c</ship_mode>
                <template_name>c</template_name>
                <style_status>c</style_status>
                <milestone_id>c</milestone_id>
                <milestone_name>c</milestone_name>
                <task_item>c</task_item>
                <colour_code>c</colour_code>
                <colour>c</colour>
                <description>c</description>
                <item_due_date>2004-01-01</item_due_date>
                <item_revised_date>2004-01-01</item_revised_date>
                <item_arrival_date>2004-01-01</item_arrival_date>
                <logon_original_plan_date>2004-01-
01</logon_original_plan_date>
                <review_plan_date>2004-01-01</review_plan_date>
                <logon_plan_date>2004-01-01</logon_plan_date>
                <logon_actual_date>2004-01-01</logon_actual_date>
                <milestone_status>c</milestone_status>
                
<logon_action_item_remarks>c</logon_action_item_remarks>
                <logon_cust_no>c</logon_cust_no>
                <logon_style_no>c</logon_style_no>
                <logon_delivery>2004-01-01</logon_delivery>
                <logon_vend_no>c</logon_vend_no>
                <logon_fact_code>c</logon_fact_code>
                <logon_ship_mode>c</logon_ship_mode>
                <logon_actn_id>c</logon_actn_id>
                <logon_action_item_code>c</logon_action_item_code>
                <logon_subitem_name>c</logon_subitem_name>
                <add_info1>c</add_info1>
                <add_info2>c</add_info2>
                <add_info3>c</add_info3>
                <add_date1>2004-01-01</add_date1>
                <add_date2>2004-01-01</add_date2>
        </item>
</action_calendar_data_exchange>

---------------------------------------end of xml file ----------------------------------------



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