i'm trying to call a function with parameters, send an id and return the url of a photo, the idea is to show the photo of the element when you click on a button, the problem is that i can't call the funcion i swear that i try it, and googled it, but i simply can't :P
here's the code of the function and the declaration
xquery version "1.0";
declare namespace local = "local"; declare option exist:serialize "method=xhtml media-type=text/html";
xquery version "1.0";
declare namespace local = "local";
declare option exist:serialize "method=xhtml media-type=text/html";
declare function local:showPhoto($id as xs:decimal?)AS xs:string?
{
for $dir in doc("pubs.xml")//dir
where id= $dir/id
return $dir/photo/text();
};
and here's the table and the code to call it, sure that if you know a better way to do it just tell me :P (of course i'm a little noob with this so i'm sure that you can tell me a better way to do it)
<table id="pubs" border="1">
{
for $directorio in doc("/db/Ocio/pubs.xml")//dir
order by $dir/name
return
<tr>
<td>{$dir/name/text()}</td>
<td><a href="{$dir/web/text()}">Web url</a></td>
<td><input onclick="{local:showPhoto($dir/id)" type="button" value="MOAR INFO"></input></td>
</tr>
}
</table>
maybe there's an error here but it's cause i translated the code to english, when i execute ir this is the error:
XPDY0002 : undefined context sequence for...
not sure what to do so i ask it, Thank you very much in advance :D :D :D
X-mas btw :3