XPath("add-attr[@attr-name='uniqueID']/value[1]

is semantically the same as:

XPath("add-attr[@attr-name='uniqueID']/value[position()=1]

Actually [1] is shorthand for [position()=1]

therefore if [$counter] is not working, I use:
[position()=$counter]

Which I think is what you are asking for.

On 6/21/2012 12:56 PM, iceman3 wrote:
>
> I am trying to go through multiple values and populate each one to a
> group membership. I can call each value tag with Global Configuration
> Value("GroupPlacement")+"\"+XPath("add-attr[@attr-name='CN']/value")+"\"+XPath("add-attr[@attr-name='uniqueID']/value[1]")
> changing the [1] to [2] etc for each value. As I will be seeing 1000's
> of these I wanted to change the number to a counter. I have the
> following but it just picks up the first value.
>
> <do-set-local-variable name="finalcount" scope="policy">
> <arg-string>
> <token-xpath expression="1"/>
> </arg-string>
> </do-set-local-variable>
> <do-for-each>
> <arg-node-set>
> <token-xpath expression="add-attr[@attr-name='uniqueID']"/>
> </arg-node-set>
> <arg-actions>
> <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['$finalcount']"/>
> </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 name="finalcount" scope="policy">
> <arg-string>
> <token-xpath expression="1+$finalcount"/>
> </arg-string>
> </do-set-local-variable>
> </arg-actions>
> </do-for-each>
>
> Also, is there another way like using the xslt position() in here for
> simplicity through policy builder?
>
> Thanks,
>
>