The title is weird but ...
In Exist-db
How to call function on the same page normaly. Just display evrythink in XML and on click on the hiperlink call self again with XPath..
I have got this function. Meaby it's fully crapy... i quess...
declare function app:WyswietlAkweny($loc, $evtObj) {
<table border="1" width="100%">
<th>Podrzędne</th><th>Nazwa</th><th>Typ</th><th>Powierzchnia</th><th>Edycja</th>
{
for $x in doc('/db/Dane/akweny.xml/')//akwen
let $nazwa := $x/nazwa,
$typ := $x/typ,
$powierzchnia := $x/powierzchnia
return <tr>
<th><a href="TO THE PARRENT"><img src="/exist/apps/Obrazki/lupa.jpg" alt="Podrzedny" /> KLIK</a></th>
<th bgcolor="#F46978">{$nazwa}</th>
<th>{$typ}</th>
<th>{$powierzchnia}</th>
<th>Edytuj</th>
</tr>
}
</table>
};
Here is my XML
<?xml version="1.0" encoding="utf-8"?>
<akweny>
<akwen>
<nazwa>Atlantycki</nazwa>
<typ>ocean</typ>
<powierzchnia>106450</powierzchnia>
<akweny>
<akwen>
<nazwa>Północne</nazwa>
<typ>morze</typ>
<powierzchnia>750</powierzchnia>
</akwen>
<akwen>
<nazwa>Batyckie</nazwa>
<typ>morze</typ>
<powierzchnia>386</powierzchnia>
<akweny>
<akwen>
<nazwa>Botnicka</nazwa>
<typ>zatoka</typ>
<powierzchnia>117</powierzchnia>
</akwen>
</akweny>
</akwen>
</akweny>
</akwen>
<akwen>
<nazwa>Spokojny</nazwa>
<typ>ocean</typ>
<powierzchnia>179700</powierzchnia>
</akwen>
</akweny>
So the problem is when i click on "KLIK" it have to show ONLY find any element akweny that have a parent element akwen and repeat to the end elements with a nazwa child with the value of current click element akwen
In short when i select nazwa=Batyckie it should show all nodes below.
Any idea?
ps. nazwa=name in Polish language