Home

Results 1 to 6 of 6

Thread: Driver policies

Threaded View

  1. #1
    Join Date
    Mar 2015
    Posts
    46

    Driver policies

    Hi ,

    I have a requirement where my operation attribute is having a userfull name value
    (for example: userfullname=x y z..)
    In this case i have to read the userfullname attribute and take the value before the first space as first name and all value after the first name as last name.

    so the expected result is firstname=x lastname=y z.....

    I wrote the below code for this but i am not able to get the desired result .. can someone help me here ?

    <do-if>
    <arg-conditions>
    <and>
    <if-op-attr name="userfullname" op="available"/>
    </and>
    </arg-conditions>
    <arg-actions>
    <do-if>
    <arg-conditions>
    <and>
    <if-xpath op="true">contains($userfullname,"#x20")</if-xpath>
    </and>
    </arg-conditions>
    <arg-actions>
    <do-set-local-variable name="var-user-name-node" scope="policy">
    <arg-node-set>
    <token-split delimiter=" "/>
    <token-op-attr name="userfullname"/>
    </arg-node-set>
    </do-set-local-variable>
    <do-set-local-variable name="var-user-firstname" scope="policy">
    <arg-string>
    <token-xpath expression="$var-user-name-node[1]"/>
    </arg-string>
    </do-set-local-variable>
    <do-set-local-variable name="var-user-lastname" scope="policy">
    <arg-string>
    <token-xpath expression='substring-after($var-user-name-node[1],"#x20")'/>
    </arg-string>
    </do-set-local-variable>
    </arg-actions>
    <arg-actions/>
    </do-if>
    </arg-actions>
    <arg-actions/>
    </do-if>

    The result of the condition <if-xpath op="true">contains($userfullname,"#x20")</if-xpath> is always false, i think the value #x20 that i am using to identify the white space is not correct, i tired different option like \s , " " , regex..but in all these cases also its giving me only a false..
    Last edited by kalariviswa; 04-Jun-2016 at 03:25 PM. Reason: Missed a point

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •