XPATH is NOT XSLT. XSLT is not XPATH.

XPATH is a way of describing XML Path references and is often used by
XSLT (or IDM in this context).

Therefore defining a variable, using XSLT will not work.

<do-set-local-variable name="thisvalue" scope="policy">
<arg-string>
<token-xpath expression='&lt;xsl:number format="1" from="@value"/>'/>
</arg-string>
</do-set-local-variable>


Also the next set dest attr will not work as you want in this one:
<do-set-dest-attr-value class-name="Group" name="Group Membership"
when="before">
<arg-value type="string">
<token-global-variable name="GroupPlacement"/>
<token-text xml:space="preserve">\</token-text>
<token-xpath expression="add-attr[@attr-name='CN']/value"/>
<token-text xml:space="preserve">\</token-text>
<token-xpath expression="add-attr[@attr-name='uniqueID']/value"/>
<token-text xml:space="preserve">[</token-text>
<token-text xml:space="preserve">$thisvalue$</token-text>
<token-text xml:space="preserve">]</token-text>
</arg-value>
</do-set-dest-attr-value>

As this line, will not work. Use the local variable tag instead.

<token-text xml:space="preserve">$thisvalue$</token-text>

which would look like:

<token-local-variable name="thisvalue"/>

Also, I think what you really need to learn about here is the very cool
special variable current-node, which is only available in a for-each loop.

So since you are looping over the UniqueID values, then current-node
should have the current value being looped over.

Consider this series of articles for some hints that will for sure help you.

http://www.novell.com/communities/no...dm-make-part-1
http://www.novell.com/communities/no...dm-make-part-2
http://www.novell.com/communities/no...dm-make-part-3
http://www.novell.com/communities/no...dm-make-part-4
http://www.novell.com/communities/no...dm-make-part-5
http://www.novell.com/communities/no...dm-make-part-6
http://www.novell.com/communities/no...dm-make-part-7
http://www.novell.com/communities/no...dm-make-part-8
http://www.novell.com/communities/no...dm-make-part-9
http://www.novell.com/communities/no...m-make-part-10
http://www.novell.com/communities/no...m-make-part-11

If you are short on time specific to your problems,
#1, #3, #5, maybe a little of #9.

Good reading nonetheless, and I guarentee you will learn at least
something. (Or else learn to hate my inability to shut up).




On 6/25/2012 10:46 AM, iceman3 wrote:
>
> I am getting a literal error with the variable declaration and do not
> know why: below is the code:
>
> <do-for-each>
> <arg-node-set>
> <token-xpath expression="add-attr[@attr-name='uniqueID']/value"/>
> </arg-node-set>
> <arg-actions>
> <do-set-local-variable name="thisvalue" scope="policy">
> <arg-string>
> <token-xpath expression='&lt;xsl:number format="1"
> from="@value"/>'/>
> </arg-string>
> </do-set-local-variable>
> <do-set-dest-attr-value class-name="Group" name="Group Membership"
> when="before">
> <arg-value type="string">
> <token-global-variable name="GroupPlacement"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath expression="add-attr[@attr-name='CN']/value"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath expression="add-attr[@attr-name='uniqueID']/value"/>
> <token-text xml:space="preserve">[</token-text>
> <token-text xml:space="preserve">$thisvalue$</token-text>
> <token-text xml:space="preserve">]</token-text>
> </arg-value>
> </do-set-dest-attr-value>
> <do-set-dest-attr-value class-name="Group" disabled="true"
> name="Group Membership">
> <arg-value type="string">
> <token-global-variable name="GroupPlacement"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath expression="add-attr[@attr-name='CN']/value"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath
> expression="add-attr[@attr-name='uniqueID']/value[2]"/>
> </arg-value>
> </do-set-dest-attr-value>
> <do-set-dest-attr-value class-name="Group" disabled="true"
> name="Group Membership">
> <arg-value type="string">
> <token-global-variable name="GroupPlacement"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath expression="add-attr[@attr-name='CN']/value"/>
> <token-text xml:space="preserve">\</token-text>
> <token-xpath
> expression="add-attr[@attr-name='uniqueID']/value[3]"/>
> </arg-value>
> </do-set-dest-attr-value>
> <do-clone-op-attr dest-name="Security Equals" src-name="Group
> Membership"/>
> <do-set-local-variable disabled="true" name="finalcount"
> scope="policy">
> <arg-string>
> <token-xpath expression="$finalcount+1"/>
> </arg-string>
> </do-set-local-variable>
> </arg-actions>
> </do-for-each>
>
>