开发者

Whats the fastest xml validator for linux platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

I work with xml files that have up to 10000 events in them each with about 30 lines. So each xml file could have 300000 lines. I want to incorporate xml validation into my pre processing process and开发者_运维问答 was wondering what are the fastest xml validation options available on a linux platform. To start off with I analysed xmllint as a validator and found that the 10000 event files took up to 1 sec (with the first taking a whopping 5 secs):

bash$ for file in `ls xml*xml`; do echo "checking $file of event length `grep '<event ' $file | wc -l`"; time xmllint --noout $file; result=`echo $?`; if [[ "$result" == "0" ]]; then echo "$file : valid"; else echo "$file : invalid returned $result"; fi; done

checking xmlEventLog_2010-03-23T06:31:49_PFS_1_2.xml of event length 810

real    0m0.251s
user    0m0.036s
sys     0m0.020s
xmlEventLog_2010-03-23T06:31:49_PFS_1_2.xml : valid
checking xmlEventLog_2010-03-23T06:42:36_PFS_1_1.xml of event length 10001

real    0m5.363s
user    0m0.564s
sys     0m0.292s
xmlEventLog_2010-03-23T06:42:36_PFS_1_1.xml : valid
checking xmlEventLog_2010-03-23T07:27:36_PFS_1_2.xml of event length 10000

real    0m1.303s
user    0m0.732s
sys     0m0.232s
xmlEventLog_2010-03-23T07:27:36_PFS_1_2.xml : valid
checking xmlEventLog_2010-03-23T07:54:42_PFW_1_1.xml of event length 990

real    0m0.098s
user    0m0.072s
sys     0m0.024s
xmlEventLog_2010-03-23T07:54:42_PFW_1_1.xml : valid
checking xmlEventLog_2010-03-23T08:10:32_PFS_1_2.xml of event length 10000

real    0m0.971s
user    0m0.712s
sys     0m0.240s
xmlEventLog_2010-03-23T08:10:32_PFS_1_2.xml : valid
checking xmlEventLog_2010-03-23T08:56:57_PFS_1_2.xml of event length 10000

real    0m1.252s
user    0m0.724s
sys     0m0.184s
xmlEventLog_2010-03-23T08:56:57_PFS_1_2.xml : valid
checking xmlEventLog_2010-03-23T09:26:10_PFS_1_2.xml of event length 10000

real    0m0.920s
user    0m0.644s
sys     0m0.260s
xmlEventLog_2010-03-23T09:26:10_PFS_1_2.xml : valid

Does anybody have faster xml validators that I could use to achieve this?

A


I believe RXP is the fastest validating XML parser or at least it has this reputation. I have used its python binding but never the plain C.

Its available from http://www.cogsci.ed.ac.uk/~richard/rxp.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜