<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Deepak,<br>
<br>
just a blind shot - try to use implicit variable named "input" (it
is mapped to the "source" of the inbound expression, in your case,
ri:orgdesc).<br>
<br>
See an example (adapted from my customer's resource) written in
Groovy (not XPath):<br>
<br>
<attribute><br>
<ref>ri:orgUnitHierarchy</ref><br>
<displayName>Organizational Hierarchy</displayName><br>
<access>read</access><br>
<inbound><br>
<expression><br>
<script><br>
<code><br>
String[] tmpHierarchyList = <b>input</b> ? <b>input</b>?.split('\\.')
: []<br>
tmpHierarchyListNew = []<br>
<br>
<!-- some processing skipped here . . . --><br>
<br>
return tmpHierarchyListNew.join(':')<br>
</code><br>
</script><br>
</expression><br>
<target><br>
<path>$user/extension/mycustomer:ouPath</path><br>
</target><br>
</inbound><br>
</attribute><br>
<br>
I do not use XPath in expressions unless absolutely necessary
because the debugging is quite _challenging_ ;) and it's lot easier
to debug Groovy statements.<br>
<br>
Regards,<br>
Ivan<br>
<br>
<div class="moz-cite-prefix">On 01/02/2014 02:50 PM, Deepak
Natarajan wrote:<br>
</div>
<blockquote cite="mid:52C56EAA.3010605@trilobytesystems.com"
type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
Hi -<br>
<br>
I'm struggling with a simple evaluation (I've removed namespace
declarations for readability) :<br>
<br>
<attribute><br>
<ref><span style="font-weight: bold;">ri:orgdesc</span></ref><br>
<inbound><br>
<expression><br>
<script><br>
<language><a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.w3.org/TR/xpath/">http://www.w3.org/TR/xpath/</a></language><br>
<code ...><br>
tokenize($account/attributes/ri:orgdesc,"/")[last()]<br>
</code><br>
</script><br>
</expression><br>
<target><br>
<path>$user/extension/apos:aposUnitAttributes</path><br>
</target><br>
</inbound><br>
</attribute><br>
<br>
I've tried everything, but the variable passed to the XPath
tokenize function is always nil (I know the function works
correctly, since I use it elsewhere, and using a literal string
above produces the correct results)<br>
<br>
I've tried including a <source> before the expression with
an explicit <name> but that doesn't seem to work either.<br>
<br>
Thanks for any input! - I'm using build <span>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
Version: 2.3-SNAPSHOT, describe: git-v2.3devel-383-g6ef8f72 </span><br>
<br>
BR/Deepak<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ing. Ivan Noris
Consultant
Evolveum, s.r.o
___________________________________________________
"Semper cautus - semper paratus - semper idem Vix."
</pre>
</body>
</html>