Re: [basex-talk] db:open(), xquery:eval(), and path()

2013-11-17 Thread Christian Grün
Hi Gerrit, db:node-id(xquery:eval(db:open('doc', 'doc.xml')/*)) = 0 some quick feedback (I'll further look into this): when running xquery:eval, a main-memory copy of the original node is created, which may have another node id than the original node. To get the node id of the original node,

Re: [basex-talk] db:open(), xquery:eval(), and path()

2013-11-17 Thread Christian Grün
for $doc in db:open('doc', 'doc.xml')/* let $nodes as element(*)* := xquery:eval($doc//*, map{doc:=$doc}) return for $node in $nodes return result path={path($node)} name={name($node)}/ I tried to rewrite you query into sth. that may be of help for you… for $doc in db:open('doc',

Re: [basex-talk] db:open(), xquery:eval(), and path()

2013-11-17 Thread Christian Grün
Ah, I see. It just felt too PHPish to synthesize the whole query as a string, therefore I thought I might use xquery:eval() ad libitum in the middle of a query and that it would operate on the same database as the static remainder of the query. …completely true. When thinking of our own

[basex-talk] db:open(), xquery:eval(), and path()

2013-11-16 Thread Imsieke, Gerrit, le-tex
I think that under certain conditions, the path() function does not return the proper paths. Here’s an example that works ok: for $doc in doca/bc//b/doc let $nodes as element(*)* := xquery:eval($doc//*, map{doc:=$doc}) return for $node in $nodes return result path={path($node)}

Re: [basex-talk] db:open(), xquery:eval(), and path()

2013-11-16 Thread Imsieke, Gerrit, le-tex
Probably related: db:node-id(xquery:eval(db:open('doc', 'doc.xml')/*)) ⇒ 0 db:node-id(db:open('doc', 'doc.xml')/*) ⇒ 1 On 16.11.2013 23:57, Imsieke, Gerrit, le-tex wrote: I think that under certain conditions, the path() function does not return the proper paths. Here’s an example that