Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
152 views
in Technique[技术] by (71.8m points)

What is the best way to validate XML against XML Schema, parsing it and storing data 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 Schema, 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...