Subject:it's possible to have a where clause with variables? Author:Matthew O'Brien Date:09 May 2007 12:59 PM
hi all,
i'll show you my problem!
it's possible to replace something like this:
for $a in doc( '/db/tesi/UtentiIstanza.xml' )/utenti/utente
where $a/credenziali/unacredenziale[nomecredenziale='CI']/residenza='Milano'
return $a/id
with something like this:
let $expcred := "credenziali/unacredenziale[nomecredenziale='CI']/residenza='Milano'"
for $a in doc( '/db/tesi/UtentiIstanza.xml' )/utenti/utente
where $a/$expcred
return $a/id
the first example works,the second no,how can i do?
I need to use this in a function and $expcred is one of my parameters
thanks a lot for your help
Matthew
_______________________________________
this is my XML
Subject:it's possible to have a where clause with variables? Author:(Deleted User) Date:11 May 2007 08:38 AM
Hi Matthew,
what you want to do is not possible, unless you use a non-standard function that lets you evaluate a query at runtime (e.g. with Saxon, it's saxon:eval)