A Forum reader recently asked:

“I’m trying to parse a nodeset and return the largest value. It sounds simple, but I’ve discovered that the xpath max function doesn’t appear to exist with Novell’s implementation.

I have a nodeset such as 01,02,03,09,05 etc that I need to parse to find the largest value. I want to do this in policies, if possible, to keep it simple. Does anyone have any brilliant ideas on how to parse this nodeset and find the largest value?”

And here is the response from Bob Stumpp …


Try a rule something like the one below. No XPATH is needed; basically, you set a local variable to “0”, then do a “for each” of your node set. If the local variable is less than the current node, update the local variable to the current node value and continue. When you are finished, the local variable will have the highest value in the node set.

<description>Finding Greatest Value</description>
    <if-class-name mode="nocase" op="equal">User</if-class-name>
  <do-set-local-variable name="local.counter" scope="policy">
      <token-text xml:space="preserve">0</token-text>
      <token-text xml:space="preserve">Enter Node Set Here</token-text>
        <if-local-variable mode="numeric" name="local.counter"
      <do-set-local-variable name="local.counter" scope="policy">
          <token-local-variable name="current-node"/>

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.
Categories: Uncategorized

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
By: bstumpp
Mar 26, 2008
8:05 am
Active Directory Authentication Automation Cloud Computing Cloud Security Configuration Customizing Data Breach DirXML Drivers End User Management Identity Manager Importing-Exporting / ICE/ LDIF Intelligent Workload Management IT Security Knowledge Depot LDAP Monitoring Open Enterprise Server Passwords Reporting Secure Access Supported Troubleshooting Workflow