Question

I've been playing around with TXMLDocument and I've been trying to work out what poAsyncLoad does in ParseOptions. The help indicates that it might improve performance on large XML files (which it doesn't seem to). The name indicates that it should be doing things in a background thread, but the UI still freezes while loading a large XML file.

Does anyone know what this does? I'm using Delphi XE3

Was it helpful?

Solution

Enabling poAsyncLoad tells the underlying DOM provider that asynchronous loading is permitted, but that is no guarantee that asynchronous loading will actually be used. It really depends on the capabilities of the underlying DOM provider. On Windows, that is MSXML by default, which does support asynchronous loading, but maybe other factors are telling it not to. But if it did, you should also assign an event handler to the TXMLDocument.OnAsyncLoad event so you can get asynchronous status updates, otherwise you would have to read the TXMLDocument.AsyncLoadState property periodically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top