I think I understand the problem now. I'm suspect you want this function to be called and its value returned when the user clicks on this anchor tag while viewing the web page:
<a href="{app:PokazRodzica($nazwa)}">
This is not what's happening. When you output this anchor tag, anything in the AVT ({}
) will be evaluated before returning. So this calls the function you referenced and stores its output literally in that attribute. What you need to is to reference an endpoint so the browser can call the function via the endpoint:
<a href="/call-app-PokazRodzica.xqy?value={$nazwa}">
Then in the endpoint script, call-app-PokazRodzica.xqy
, accept a value
parameter, and call your function:
app:PokazRodzica($value-param)
Now, when your user clicks on the anchor, it will call the endpoint and pass it the value. The browser will then return the results of the endpoint call.