Expression Example

The following example, based on a hypothetical User profile, evaluates to True for all users with the following attributes:

  • Baseball and jai alai are their favorite sports,
  • They are at least 65 years old, and
  • They either have a home area code of 425, or
  • The expression with an ID of 34 is True

Another way of representing these attributes is:

(Baseball and jai alai are their favourite sports AND [They are at least 65 years old AND{They either have a home are code of 425 OR The expression with an ID of 34 is True}])

<TERM TYPE="and">
   <CLAUSE OPER="in">
      <PROPERTY ID="User.FavoriteSports" TYPE="string" />
      <IMMED-VAL TYPE="string" MULTIVAL="True">
         <VALUE>baseball</VALUE>
         <VALUE>jai alai</VALUE>
      </IMMED-VAL>
   </CLAUSE>

   <TERM TYPE="and">
      <CLAUSE OPER="at-least">
         <PROPERTY ID="User.Age" TYPE="number" />
         <IMMED-VAL TYPE="number">65</IMMED-VAL>
      </CLAUSE>

      <TERM TYPE="or">
         <CLAUSE OPER="begins-with">
            <PROPERTY ID="User.ContactInfo.HomePhone" TYPE="string" />
            <IMMED-VAL TYPE="string">425</IMMED-VAL>
         </CLAUSE>
         <CLAUSE OPER="is-true">
            <EXPR-REF ID="34" />
         </CLAUSE>
      </TERM>
   </TERM>
</TERM>

The following is a catalog example:

Manufacturer equal to Apparel Inc. AND productID equals A1234 AND (isDiscountable is equal to 1 OR onSale is equal to 1)

<TERM TYPE="and">
<CLAUSE OPER="equal">
<Property ID="product._product_Manufacturer" TYPE="STRING"/>
<IMMED-VAL TYPE="string"><![CDATA[Apparel Inc.]]></IMMED-VAL>
</CLAUSE>
<CLAUSE OPER="equal">
<Property ID="product._product_ProductID" TYPE="STRING"/>
<IMMED-VAL TYPE="string"><![CDATA[A1234]]></IMMED-VAL>
</CLAUSE>
<TERM TYPE="or">
<CLAUSE OPER="equal">
<Property ID="product._product_OnSale" TYPE="NUMBER"/>
<IMMED-VAL TYPE="number">1</IMMED-VAL>
</CLAUSE>
<CLAUSE OPER="equal">
<Property ID="product._product_isDiscountable" TYPE="NUMBER"/>
<IMMED-VAL TYPE="number">1</IMMED-VAL>
</CLAUSE>
</TERM> 
</TERM> 

Copyright © 2005 Microsoft Corporation.
All rights reserved.