Hi!

I'm trying to split up a modify into one modify for each modify-attr,
independant from the name of the modify-attr:

i.E.

Before it looks like:
<?xml version="1.0" encoding="UTF-8"?><nds dtdversion="3.0"
ndsversion="8.x">
<source>
<product version="3.0.10.20060630 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify class-name="User"
event-id="ksi-lab#20080708132536#1#46"
qualified-src-dn="...\OU=LAB\OU=User\OU=Alumni\CN=Gabi Test"
src-dn="...\LAB\User\Alumni\Gabi Test" src-entry-id="33971"
timestamp="1215523954#12">
<modify-attr attr-name="Telephone Number">
<remove-value>
<value timestamp="1215523536#46"
type="teleNumber">+49 228 12345</value>
</remove-value>
<add-value>
<value timestamp="1215523954#12"
type="teleNumber">1234</value>
</add-value>
</modify-attr>
<modify-attr attr-name="hrDisabled">
<remove-value>
<value timestamp="1215523536#69"
type="state">true</value>
</remove-value>
</modify-attr>
</modify>
</input>
</nds>


After it should look like:

<?xml version="1.0" encoding="UTF-8"?><nds dtdversion="3.0"
ndsversion="8.x">
<source>
<product version="3.0.10.20060630 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify class-name="User"
event-id="ksi-lab#20080708132536#1#46"
qualified-src-dn="...\OU=LAB\OU=User\OU=Alumni\CN=Gabi Test"
src-dn="...\LAB\User\Alumni\Gabi Test" src-entry-id="33971"
timestamp="1215523954#12">
<modify-attr attr-name="Telephone Number">
<remove-value>
<value timestamp="1215523536#46"
type="teleNumber">+49 228 12345</value>
</remove-value>
<add-value>
<value timestamp="1215523954#12"
type="teleNumber">1234</value>
</add-value>
</modify-attr>
</modify>
<modify class-name="User"
event-id="ksi-lab#20080708132536#1#46"
qualified-src-dn="...\OU=LAB\OU=User\OU=Alumni\CN=Gabi Test"
src-dn="...\LAB\User\Alumni\Gabi Test" src-entry-id="33971"
timestamp="1215523954#12">
<modify-attr attr-name="hrDisabled">
<remove-value>
<value timestamp="1215523536#69"
type="state">true</value>
</remove-value>
</modify-attr>
</modify>
</input>
</nds>


I searched the group and cool solutions. There I found this article:
http://www.novell.com/communities/no...mized-modifies
but it did not really help me, because the splitting depends on the name
of the attr.

I tried it myself that way:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC
"policy-builder-dtd" "C:\Programme
(x86)\Novell\Designer2.1.1\Designer\eclipse\plugin s\com.novell.designer.idm.oldpolicybuilder_2.0.0.2 00710261247\DTD\dirxmlscript.dtd"><policy>
<rule>
<description>Teile Modify</description>
<conditions>
<and>
<if-operation op="equal">modify</if-operation>
</and>
</conditions>
<actions>
<do-for-each>
<arg-node-set>
<token-xpath expression="./modify-attr"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="node">
<arg-node-set>
<token-local-variable name="current-node"/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="attr-name">
<arg-string>
<token-xpath expression="$node/@attr-name"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="add-value">
<arg-string>
<token-xpath
expression="./modify-attr[@attr-name=$attr-name]/add-value/value/text()"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="remove-value">
<arg-string>
<token-xpath
expression="./modify-attr[@attr-name=$attr-name]/remove-value/value/text()"/>
</arg-string>
</do-set-local-variable>
<do-strip-xpath
expression="./modify-attr[@attr-name=$attr-name]"/>
<do-add-dest-attr-value name="$attr-name">
<arg-value type="string">
<token-local-variable name="add-value"/>
</arg-value>
</do-add-dest-attr-value>
<do-remove-dest-attr-value name="$attr-name"
when="after">
<arg-value>
<token-local-variable name="remove-value"/>
</arg-value>
</do-remove-dest-attr-value>
</arg-actions>
</do-for-each>
</actions>
</rule>
</policy>


But the result of this policy is not what I wanted:

<nds dtdversion="3.0" ndsversion="8.x">
<source>
<product version="3.0.10.20060630 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify class-name="User" event-id="ksi-lab#20080708132536#1#46"
qualified-src-dn="...\OU=LAB\OU=User\OU=Alumni\CN=Gabi Test"
src-dn="...\LAB\User\Alumni\Gabi Test" src-entry-id="33971"
timestamp="1215523954#12">
<modify-attr attr-name="$attr-name">
<add-value>
<value type="string">1234</value>
</add-value>
</modify-attr>
<modify-attr attr-name="$attr-name">
<remove-value>
<value>+49 228 12345</value>
</remove-value>
</modify-attr>
<modify-attr attr-name="$attr-name">
<add-value>
<value type="string"/>
</add-value>
</modify-attr>
<modify-attr attr-name="$attr-name">
<remove-value>
<value>true</value>
</remove-value>
</modify-attr>
</modify>
</input>
</nds>


Could anyone aid me and tell me how to write it correctly within the
for-each?
Can I do it within policies or do I have to write a dirxml 1.1a StyleSheet?


Regards,
Christine