Hi all,

I need to reformat a multivalue operation attribute in this way:

-before-
h3mis751|gyiboa|1380|1301|disabled|Wed Jan 20 01:00:00 2010|Wed Mar 5
20:38|nominal|xxx
h4mis751|gyiboa|1380|1301|disabled|Wed Jan 20 01:00:00 2010|Wed Mar 5
20:38|nominal|xxx
h5mis751|gyiboa|1380|1301|disabled|Wed Jan 20 01:00:00 2010|Wed Mar 5
20:38|nominal|xxx
h6mis751|gyiboa|1380|1301|disabled|Wed Jan 20 01:00:00 2010|Wed Mar 5
20:38|nominal|xxx

-after-
PWDCHG-h3mis751|gyiboa
PWDCHG-h4mis751|gyiboa
PWDCHG-h5mis751|gyiboa
PWDCHG-h6mis751|gyiboa

I have this rule but it doesn't work, the operation attribute change
with the last XPath value from the "for-each" action:

<rule>
<description>TEST</description>
<conditions>
<and>
<if-operation disabled="true" mode="case"
op="equal">instance</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable name="TEST" scope="policy">
<arg-node-set>
<token-op-attr name="unix-account"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-local-variable name="TEST"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="PWDInt" scope="policy">
<arg-string>
<token-local-variable name="current-node"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="PWDParts" scope="policy">
<arg-node-set>
<token-split delimiter="\|">
<token-local-variable name="PWDInt"/>
</token-split>
</arg-node-set>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">HOSTNAME: </token-text>
<token-xpath expression="$PWDParts[1]"/>
</arg-string>
</do-trace-message>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">ACCOUNT: </token-text>
<token-xpath expression="$PWDParts[2]"/>
</arg-string>
</do-trace-message>
<do-reformat-op-attr name="unix-account">
<arg-value type="string">
<token-text xml:space="preserve">PWDCHG-</token-text>
<token-xpath expression="$PWDParts[1]"/>
<token-text xml:space="preserve">|</token-text>
<token-xpath expression="$PWDParts[2]"/>
</arg-value>
</do-reformat-op-attr>
</arg-actions>
</do-for-each>
</actions>
</rule>

The result is:

<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product version="?.?.?.?">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<add class-name="User">
<add-attr attr-name="unix-account">
<value type="string">PWDCHG-h6mis751|gyiboa</value>
<value type="string">PWDCHG-h6mis751|gyiboa</value>
<value type="string">PWDCHG-h6mis751|gyiboa</value>
<value type="string">PWDCHG-h6mis751|gyiboa</value>
</add-attr>
</add>
</input>
</nds>

Somebody can help me?

thanks!


--
dpanichi
------------------------------------------------------------------------
dpanichi's Profile: https://forums.netiq.com/member.php?userid=815
View this thread: https://forums.netiq.com/showthread.php?t=50380