开发者

What is the best way to validate XML against XML Schema, parsing it and storing data back to MySQL Database using Perl?

开发者 https://www.devze.com 2022-12-08 12:28 出处:网络
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 ?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号