In addition to solution 1 by
Sergey Alexandrovich Kryukov[
^], i'd suggest to read these articles:
XML Schema (XSD) Validation with XmlSchemaSet[
^]
Validation of XML with Schemas[
^]
Tip:
Schema expects
customer
element and its field
customer_PK
, but the first element in xml is
Import
, so xml file should looks like:
<customer>
<customer_PK>1</customer_PK>
</customer>
If you would like to store several
customers
, you need to change schema and xml structure to:
<customers>
<customer>
<customer_PK>1</customer_PK>
</customer>
<customer>
<customer_PK>2</customer_PK>
</customer>
</customers>