Problem

A Forum reader recently asked:

“After doing a source query, you get an “Instance” document back. How can I add a default attribute to this document? I think I need to use do-append-xml-text or element, but I have not found any examples of this.”

And here’s the response from Father Ramon …

Solution

Try this:

<rule>
  <description>add default attribute to instance</description>
  <conditions>
   <and>
    <if-operation mode="case" op="equal">instance</if-operation>
    <if-class-name mode="nocase" op="equal">User</if-class-name>
   </and>
  </conditions>
  <actions>
   <do-append-xml-element expression="." name="attr"/>
   <do-set-xml-attr expression="attr[last()]" name="attr-name">
    <arg-string>
     <token-text>MyAttrName</token-text>
    </arg-string>
   </do-set-xml-attr>
   <do-append-xml-element expression="attr[last()]" name="value"/>
   <do-append-xml-text expression="attr[last()]/value[last()]">
    <arg-string>
     <token-text>the value of the attribute</token-text>
    </arg-string>
   </do-append-xml-text>
  </actions>
</rule>
0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
netiqcoolguys
Feb 28, 2007
4:31 am
Reads:
1,589
Score:
Unrated
Active Directory Automation Cloud Computing Cloud Security Configuration Customizing Data Breach DirXML Drivers End User Management Identity Manager Importing-Exporting / ICE/ LDIF Intelligent Workload Management Knowledge Depot LDAP Migrating from Windows XP or 2003 to SUSE Linux Monitoring Open Enterprise Server Passwords Reporting Secure Access Sentinel Supported Troubleshooting Workflow