I have a rule my boss wrote that looks for empty attributes, and strips
them out of the document. (In the previous rule he makes sure anything
multivalued in eDir but not in AD is now single valued by removing extra
attributes.). Whatever. Very elegant, very cute, figure out how he did
it on your own.

I get through that unharmed. It is Login Disabled, with the value being
removed.

Then the test for empty attributes is:

The event is:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.6.1.4427">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify cached-time="20090512185828.494Z" class-name="User"
event-id="mta-gwlab#20090512185828#1#1" qualified-src-dn="O=Acme\OU
=Users\CN=qsmith2" src-dn="\ACME-LAB-IDV\Watts\Users\qsmith2"
src-entry-id="34206" timestamp="0#0">
<association
state="associated">4a49d9f318ed82428e9c08e82613b2e b</association>
<modify-attr attr-name="Login Disabled">
<remove-value>
<value timestamp="1242154606#9" type="state">true</value>
</remove-value>
</modify-attr>
</modify>
</input>
</nds>

The Schema map fires but does not update the shown doc, so the
@attr-name is actually changed to dirxml-uACAccountDisable but that is
basically immaterial I think.

The rule in the AD driver OUtput transform is:

<rule>
<description>[Acme] Strip Blank Values</description>
<comment xml:space="preserve">Removes any blank values</comment>
<conditions>
<or>
<if-operation mode="case" op="equal">add</if-operation>
<if-operation mode="case" op="equal">modify</if-operation>
</or>
</conditions>
<actions>
<do-for-each>
<arg-node-set>
<token-xpath expression=".//@attr-name"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="REMOVED" scope="policy">
<arg-string>
<token-removed-attr name="$current-node$"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-op-attr mode="nocase" name="$current-node$" op="equal"/>
<if-local-variable mode="nocase" name="REMOVED" op="equal"/>
</and>
</arg-conditions>
<arg-actions>
<do-strip-op-attr name="$current-node$"/>
</arg-actions>
<arg-actions/>
</do-if>
</arg-actions>
</do-for-each>
</actions>
</rule>

The original rule did not account for Removed attribute events. And
stripped them out.

Ok, then I changed it as above to handle Removed attributes as well.

Run it through the engine, and it decides the the REMOVED value is null.

Run it through the simulator, and it works perfect. REMOVED is equal to
"true".

I pasted the event into simulator, and it looks good, I do not see why
it is not working in the real world. Trace is below... Same event
(Since I swiped it from the original trace).


[05/12/09 15:53:55.278]:AMERICAS-AD ST: Applying rule '[Acme] Strip
Blank Values'.
[05/12/09 15:53:55.279]:AMERICAS-AD ST: Action:
do-for-each(arg-node-set(token-xpath(".//@attr-name"))).
[05/12/09 15:53:55.279]:AMERICAS-AD ST:
arg-node-set(token-xpath(".//@attr-name"))
[05/12/09 15:53:55.279]:AMERICAS-AD ST:
token-xpath(".//@attr-name")
[05/12/09 15:53:55.279]:AMERICAS-AD ST: Token Value:
{@attr-name = "dirxml-uACAccountDisable"}.
[05/12/09 15:53:55.279]:AMERICAS-AD ST: Arg Value: {@attr-name
= "dirxml-uACAccountDisable"}.
[05/12/09 15:53:55.284]:AMERICAS-AD ST: Performing actions for
local-variable(current-node) = @attr-name = "dirxml-uACAccount
Disable".
[05/12/09 15:53:55.284]:AMERICAS-AD ST: Action:
do-set-local-variable("REMOVED",scope="policy",token-removed-attr("$current
-node$")).
[05/12/09 15:53:55.284]:AMERICAS-AD ST:
arg-string(token-removed-attr("$current-node$"))
[05/12/09 15:53:55.285]:AMERICAS-AD ST:
token-removed-attr("$current-node$")
[05/12/09 15:53:55.285]:AMERICAS-AD ST: Expanded variable
reference '$current-node$' to 'dirxml-uACAccountDisable'.
[05/12/09 15:53:55.285]:AMERICAS-AD ST: Token Value: "".
[05/12/09 15:53:55.285]:AMERICAS-AD ST: Arg Value: "".
[05/12/09 15:53:55.285]:AMERICAS-AD ST: Action: do-if().
[05/12/09 15:53:55.286]:AMERICAS-AD ST: Evaluating conditions.
[05/12/09 15:53:55.286]:AMERICAS-AD ST: Expanded variable
reference '$current-node$' to 'dirxml-uACAccountDisable'.
[05/12/09 15:53:55.286]:AMERICAS-AD ST: (if-op-attr
'$current-node$' equal "") = TRUE.
[05/12/09 15:53:55.286]:AMERICAS-AD ST: (if-local-variable
'REMOVED' equal "") = TRUE.
[05/12/09 15:53:55.287]:AMERICAS-AD ST: Performing if actions.
[05/12/09 15:53:55.287]:AMERICAS-AD ST: Action:
do-strip-op-attr("$current-node$").
[05/12/09 15:53:55.287]:AMERICAS-AD ST: Expanded variable
reference '$current-node$' to 'dirxml-uACAccountDisable'.
[05/12/09 15:53:55.287]:AMERICAS-AD ST:Policy returned: