Of course, i meant recursion. Sorry :-)<br><br>The thing is that later in XML there can be referance to that fields:<br>&lt;somewhere-it-is-used&gt;<br>   &lt;what-the-name--of-var-is&gt;<br>        &lt;ref&gt;name1&lt;/ref&gt;<br>
        &lt;ref&gt;name3 &#39;sdsdsd&#39;&lt;/ref&gt;<br>   &lt;what-the-name--of-var-is&gt;<br>&lt;somewhere-it-is-used&gt;<br><br>So, as you see, the full path doesn&#39;t need to go through all nodes. Also, there can be part to cut as string, but just ignore that now (i forgot to remove replace function from previous example).<br>
<br>And for that i need to replace several calls with longer parameter list with one in recursive mode. My tries ended in failure as i couldn&#39;t store the current state (script nature of XQuery).<br><br>Thanks,<br>Michal<br>
<br><div class="gmail_quote">On Tue, Mar 10, 2009 at 11:26 PM, David Carlisle <span dir="ltr">&lt;<a href="mailto:davidc@nag.co.uk">davidc@nag.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
&gt; The replace is only to clean the data. In  real examples, it can be called<br>
&gt; like: name1/name2 &#39;asdas&#39;/name3 &#39;saadsf&#39;.<br>
<br>
<br>
</div>but you haven&#39;t said what output you want,<br>
<div class="im"><br>
&gt; The mail thing is that recurrency.<br>
<br>
</div>not sure what you mean by recurrency in this context, do you mean<br>
recursion? Your posted code doesn&#39;t use recursive functions, probably it<br>
should use a single recursive function rather than multiple functions<br>
with longer and longer argument lists, but I can&#39;t guess what they are<br>
intended to do, so I can&#39;t suggest a replacement without more information.<br>
<br>
Is the input your posted xml and a string of the form &quot;name1/name2&quot;  ?<br>
if so, what is the desired output.<br>
<br>
Please respond on list so others have a chance to answer.<br>
<div><div></div><div class="h5"><br>
David<br>
<br>
________________________________________________________________________<br>
The Numerical Algorithms Group Ltd is a company registered in England<br>
and Wales with company number 1249803. The registered office is:<br>
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.<br>
<br>
This e-mail has been scanned for all viruses by Star. The service is<br>
powered by MessageLabs.<br>
________________________________________________________________________<br>
</div></div></blockquote></div><br>