From: Martin H. <mh...@uv...> - 2006-12-21 22:34:36
|
Hi there, Pierrick Brihaye wrote: > Hi, > > [please follow RFC 1855 - Netiquette - rules if you want me to help you] I was actually just reporting eXist's behaviour; the problem isn't there if I write good XQuery (with node() as the function return value). > > Martin Holmes a écrit : > >> This is interesting. Using your simplified code below, I do indeed >> get an error popup. However, if I use my code (with a couple of >> syntax errors fixe), then I get a freeze that has to be killed >> through Task Manager. Here's the code: >> >> declare namespace f="http://exist-db.org/f-functions"; >> >> declare function f:GetDoc() as element()* { let $fname := >> 'emls1-1.xml', $coll := '/db/emls/', $docpath := concat($coll, >> $fname) return if (fn:doc-available($docpath)) then fn:doc($docpath) >> else <p>{$docpath} is not available.</p> >> >> }; >> >> f:GetDoc() > > This is mine, which *has to* be equivalent : I guess that would depend on what's in your database, really. > declare function local:GetDoc() as element()* { > fn:doc("/db/test.xml") > }; > local:GetDoc() > > I get : > > An exception occurred during query execution: FORG0001: document(Table) > is not a sub-type of element [at line 1, column 30] > In call to function: > local:GetDoc() [4:1] > > ... which is normal IMHO. That's what I would expect. Nevertheless, it's not what happens; I get a freeze. >> Now, it only dies if the document exists in the db; otherwise it >> returns the p tag with the "not available" message. > > How big is your /db/emls/emls1-1.xml document ? Aren't you simply > flooding the result window ? I don't think so; I can get the doc back using other methods (such as straight XPath). > >> So I think what's happening is that eXist is retrieving the document, >> but at the point that it's delivering it as the result of the >> function, the mismatch between the function return type and the >> result of the query causes a fatal freeze. > > My example seems to demonstrate that it is not the case, doesn't it ? > > I may be missing something obvious but I really can't understand how > your query could freeze the client unless you have exhausted the GUI > capabilities. What about, for example, assigning more memory to the client ? I'll try that after Christmas. But if you're sure it must be my fault and can't be a bug, then I'm happy to stop worrying about it and we can both get on with something else :-) Cheers, Martin |