开发者

Flex 4 and Large XML files

Does anyone have experience with working with large local XML files? Let's say 100.0开发者_StackOverflow社区00 lines.

How feasible is it to do that with Flex 4.5 running on AIR?

Thank you.


The answer is it will work, in theory. But it will work very slow. e4x will traverse but there is nothing API wise that will tell you when an operation on the root's children will complete. It will give the impression that your app is hanging. There used to be a limitation of 4GB file reference size but I believe things have changed. I'm not sure if AIR is attuned to the difference between 32-bit and 64-bit systems. In the case of 32-bit, there is 2GB limit that when broken a flash.errors.MemoryError will be thrown by the runtime. 100,000 lines of XML is not too bad but it can get pretty bloated if there is all kinds of namespaces, massive text blobs and the opening/closing tags.


If you don't need full-blown XML syntax for parsing your files, you might consider creating custom parser, sort of SAX instead of default DOM model. Open that file, read line by line and stream the info into SQLite (lots of inserts will be more or less fast for non-indexed table.) This will let you do the job in limited portions without GUI freeze (although it may be not important for one-time conversion.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜