# matching-rule

Deprecated as of DirXML 2.0 - use DirXMLScript <rule> and <do-find-matching-object>.

<matching-rule> is used to specify the criteria for finding a matching object for automatic association of a new object as a result of an <add> event.

When a <matching-rule> is evaluated, it first checks whether or not this is a suitable rule for the <add> event in question. It does this by checking if any <match-class> are specified by the rule. If so then the rule is only suitable if the class-name on the event matches the class-name on one of the <match-class>. It then checks if any <match-attr> criteria is specified by the rule. If so, the rule is only suitable if the <add> contains an attribute value for each attribute specified by a <match-attr>. If a rule is determined to not be suitable it is skipped.

Once a suitable rule is found, a <query> is generated based on the criteria specified by the rule ( <match-attr> and <match-path>), and the class-name and attribute values specified by the <add>. This query is sent to the destination (eDirectory or driver). Any <instance> elements returned are considered matches.

Example

See <matching-rules>

## 1. Allowed Content

> match-class
>   Match a class-name. Deprecated as of DirXML 2.0.
> match-path
>   Match a path. Deprecated as of DirXML 2.0.
> match-attr
>   Match an attribute. Deprecated as of DirXML 2.0.

## 2. Attributes

> Attribute | Value(s) | Default Value
> --- | --- | ---
> description | CDATA Description of this rule, primarily for use in ConsoleOne. | #IMPLIED

## 3. Content Rule

> ( match-class * , match-path ? , match-attr * )

## 4. Parent Elements

> matching-rules
>   Top level element for object matching rules. Deprecated as of DirXML 2.0.

Top Elements || All Elements || Tree