Page 1 of 1

Can't stop a runaway XPath expression

Posted: Wed May 15, 2019 5:29 pm
by dsewell
Just now, by mistake I entered an XPath expression like this to search in a large XML document:

Code: Select all

//distinct-values(//myElement)
when I meant to put

Code: Select all

distinct-values(//myElement)
Because of the mistake, oXygen is recursing through everything in the document tree and using 100% CPU while doing it. The program is unresponsive and I either can't click on the "STOP" square, or it isn't doing anything.

In a situation like this, is there anything that can be done to force a stop to the operation, other than killing oXygen? (I am running it under OS X, so the nuclear option is Force Quit.)

Re: Can't stop a runaway XPath expression

Posted: Wed May 15, 2019 5:32 pm
by dsewell
(After about 10 minutes, the operation finally stopped with an out-of-memory error and I was able to save the file and proceed.)

Re: Can't stop a runaway XPath expression

Posted: Thu May 16, 2019 10:51 am
by adrian
Hi,

If you use the XPath toolbar, a red square (stop button) appears on the right side off the XPath combo box (in place of the list expand widget).
If you have used the XPath/XQuery Builder view the Execute XQuery button from its toolbar turns into a stop button.

In practice, it's possible that by the time you decide to stop it, the XPath execution has already generated too many results and the application is already running low on memory and the UI is unresponsive. If that's the case and you have unsaved files, it's best to let it run its course and it will eventually run out of Java memory, show you the memory error and become responsive again enough so that you can save your files and restart.

Regards,
Adrian

Re: Can't stop a runaway XPath expression

Posted: Thu May 16, 2019 4:22 pm
by dsewell
Right, in my case the application was unresponsive by the time I hit the stop button. I guess the lesson is to be more careful in constructing XPath/XQuery expressions with large files/projects.