|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] using a context node in a for loopDavid Carlisle davidc at nag.co.ukTue Oct 17 17:05:03 PDT 2006
> Should the function below work?
no:-)
a function does not automatically pass the current context,
. is undefined in a function body, so you can't use relative paths like
'@id and @db-ref
Built in functions can take an empty param list () and automatically work on
the current node, but user defined ones can not do that: you have to call
it as
local:display-user-groups(.)
^
and define it as
declare function local:display-user-groups($here as element()) as
element()* {
...
then use $here/@id $here/@db-ref
or give yourself a current node again by
$here/
(for $user-group ....
in which case you can use {@id} as you have now.
(The same is true for xslt2 functions by the way)
David
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






