My xml file have this look:
<Customers>
<Customer>
<name>foo</name>
<age>18</age>
<sexe>Male</sexe>
<Customer>
<Customer>
<name>foo1</name>
<age>25</age>
<sexe>Female</sexe>
<Customer>
.
.
.
.
.
.
</Customers>
It's a huge XML file(over hundred thousands of customers) which I need to unmarshall then put into my database, it's a monthly task.
I need to make some validation on it and then if the customer is correct save it into the database, if any data of the customer is incorrect, log the error and skip this customer.
I was thinking about writing my validation rules into the xsd then during unmarshalling using the ValidationEventHandler ignore the whole customer.
Anyone have any idea how I can do that? Or any other solution?
I've been searching for hours on the web and haven't find any answer.