You are not logged in.
I'm trying to edit a 365 kb XML file in various GTKeditors (medit, gedit, geany,...) but I'm slightly baffled by how the simple task of colour coding can slow the editing to a halt. Runing htop in a window beside the editor I can see that scrolling whether up/down or jsut sideways (not retrieving new lines) will set the cpu in Performance mode and eat up all of my 2.0GHz! Saving the same file as a text file or turning off colour coding makes the problem go away.
I kinda need colour coding to amke sense of the thing but it's like editing in treacle. Does anybody else get this and/or have any suggestions? I'm assuming that it's just badly coded cause surely the task isn't all that complicated?
Last edited by chochem (2009-05-06 22:51:48)
Offline
The main problem is that most XML editors are required to parse and in some kind interpret the file contents in order to color code. In most implementations it is necessary to read a whole tag sequence from its starting <tag> to its ending </tag>. This requires lots of memory and processing power.
Nevertheless, using up all cpu is somewhat unusual, unless your XML file is very deeply structured.
Last edited by bernarcher (2009-05-06 14:26:30)
To know or not to know ...
... the questions remain forever.
Offline
The main problem is that most XML editors are required to parse and in some kind interpret the file contents in order to color code. In most implementations it is necessary to read a whole tag sequence from its starting <tag> to its ending </tag>. This requires lots of memory and processing power.
Nevertheless, using up all cpu is somewhat unusual, unless your XML file is very deeply structured.
I see what you mean... I can't really say - it was a mac .pages file that I found that I could edit by unzipping the contents and then editing the raw innards. I've put it up here: index.xml
Offline
I got it. The file consist of one single line only. If you insert newlines between each "><" it should be easily editable.
I did convert it in vim, using
:%s#><#>^M<#g
where the ^M must be input as control character (ctrl-v, <enter>).
To know or not to know ...
... the questions remain forever.
Offline
of course... I had just got used to switching on text wrapping that I didn't even think about anymore. Thanks for your help, bernarcher.
(oh and I'll take sed over vim any day, thankyouverymuch )
Offline