With a normal <modify> input document like:

<input>
<modify class-name="User" qualified-src-dn="O=Test\OU=Users\CN=Bob"
src-dn="\TestTree\Test\Users\Bob" src-entry-id="86621"
timestamp="1397466828#5">
<modify-attr attr-name="Foo">
<remove-value>
<value>ovalue</value>
</remove-value>
<add-value>
<value>nvalue</value>
</add-value>
</modify-attr>
<modify-attr attr-name="Bar">
<remove-value>
<value>ovalue</value>
</remove-value>
<add-value>
<value>nvalue</value>
</add-value>
</modify-attr>
<modify-attr attr-name="Baz">
<remove-value>
<value>ovalue</value>
</remove-value>
<add-value>
<value>nvalue</value>
</add-value>
</modify-attr>
</modify>
</input>

I need a nodeset of the attribute names being modified
{"Foo","Bar","Baz"}. This looked easy at first, but my XPath is failing
me. I got it working with brute force and ignorance:

<actions>
<do-set-local-variable name="attrs" scope="policy">
<arg-node-set>
<token-xpath expression="modify-attr/@attr-name"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-local-variable name="attrs"/>
</arg-node-set>
<arg-actions>
<do-if>
<arg-conditions>
<and>
<if-xpath op="true">$attr-names</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="attr-names" scope="policy">
<arg-node-set>
<token-local-variable name="attr-names"/>
<token-xpath expression="string($current-node)"/>
</arg-node-set>
</do-set-local-variable>
</arg-actions>
<arg-actions>
<do-set-local-variable name="attr-names" scope="policy">
<arg-node-set>
<token-xpath expression="string($current-node)"/>
</arg-node-set>
</do-set-local-variable>
</arg-actions>
</do-if>
</arg-actions>
</do-for-each>
</actions>

but it seems like there should be a better way to do this without needing
the for() loop.


--
--------------------------------------------------------------------------
David Gersic dgersic_@_niu.edu
Knowledge Partner http://forums.netiq.com

Please post questions in the forums. No support provided via email.
If you find this post helpful, please click on the star below.