Currently I am working with XML and I want to know what would be best approach to validate XML against XML Schem开发者_如何学Ca, parse it and store it back to MySQL database using Perl ?
I think of XML::Xerces for parsing purpose but not sure if it's the right approach.
Note: I have very large XML file >1GB size.
XML Xerces will match your needs. I am using it and i really like it.
In addition to your first edit:
Since your XMl File is very big you have to think of optimizing your parsing process since lot of memory and time can be used for that.
Found an nice small example to get started:
XML Validation with Perl
Another Add:
If you dont want to write simple XML to your Database...it is important that you have an eye on your data, since your validation is outdated after you've written it to the Database in a different form. Be sure that you validate with a good scheme and some extra validators. Large XML can be tricky sometimes.
You could use a XSD to validate the XML and if you can format the XML into something MySQL can just import/insert. Here is an example
精彩评论