How to set EditorDocument.Text with XML string

SyntaxEditor for WPF Forum

Posted 12 years ago by matthias kossiek
Version: 11.1.0545
Avatar
Hi,
is there a problem to write a a XML string, loaded from a XML-File, to the EditorDocument.Text Property?
Loading a 2 MB file we have found that this takes a very long time.
Are there any performance tricks we could use?

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matthias,

Just call document.SetText(xml). It should about instantly.

If you are using our XML language from the Web Languages Add-on, make sure you follow all the steps in its Getting Started documentation topic. Otherwise it will be doing all the parsing in the UI thread, which will severely impact loading/editing performance. If you follow the Getting Started steps, it will pop right in and be editable.


Actipro Software Support

Posted 12 years ago by matthias kossiek
Avatar
Hi,
thanks for reply.
We would like to use the editor running async. Our problem is that we use the AST-Tree
parsed from the document. It must be present as fast as possible.
It would be nice to do a minimum parse for the AST and then a parse for XML-Intellisense, outlining etc..
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matthias,

I would say that most of the parsing work is just the parsing/AST building, and code outlining is probably a fraction of that time. IntelliPrompt is done upon request so that doesn't contribute to any performance degredation during the parsing phase.

I'd recommend that you attach to your document parse data changed event. That way you can be notified when the parsing is complete from the worker thread and the AST is ready for use.


Actipro Software Support

Posted 12 years ago by matthias kossiek
Avatar
Hi,
that's exactly what we are doing now ,-)
But now I know that we are on the right way.
Thanks
The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.