Checking for Blank Attributes in DirXML
Novell Cool Solutions: Tip
Digg This -
Posted: 18 Apr 2007
A Forum reader recently asked:
"I'm trying to configure an Xml policy (DirXML 2.0.2) to check for blank attributes (workforceID) and veto the operation if blanks are found. The first rule checks if the attribute is even available, then creates a local variable for it. The next rule is: if local variable "test" match ".+" then continue, but the driver doesn't seem to understand ".+" - which I took from another sample policy. How can I identify if an attribute (this one happens to be numeric) is blank?"
And here's the response from Father Ramon ...
A regular expression match of ".+" should work. I would think what you are looking for is something more like this:
<rule> <conditions> <or> <if-op-attr name="workforceID" op="not-available"/> <if-op-attr name="workforceID" op="equal"/> </or> </conditions> <actions> <do-veto/> </actions> </rule>
This is assuming that what you want to do is veto if the workforceID is missing or present, but equal to blank. If what you want to do is only veto if it is present and blank, remove the first condition.
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com