XML syntax for file-based record filter expressions

The syntax for file-based record filter expressions closely mirrors the query level syntax, with some differences.

The file-based differences from the query-level syntax are:
  • In place of the AND, OR, NOT, and FILTER operators, the FILTER_AND, FILTER_OR, FILTER_NOT, and FILTER_NAME XML elements are used, respectively.
  • In place of the property and dimension value syntax used for query expressions, the PROP, DVAL_ID, and DVAL_PATH elements are used. Note that the DVAL_PATH element’s PATH attribute requires that paths for dimension values and property values be separated by colons, not forward slashes.
  • Instead of parentheses to enclose operand lists, normal XML element nesting (implicit in the locations of element start and end tags) is used.

The full DTD for XML file-based record filter expressions is provided in the filter.dtd file packaged with the Endeca software release.

Examples of file-based filter expressions

As an example, the following query-level expression:
OR(AND(Manufacturer:Sony,1001),
   AND(Manufacturer:Aiwa,NOT(1002)), Manufacturer:Denon)
is represented as a file-based expression using the following XML syntax:
<FILTER>
  <FILTER_OR>
    <FILTER_AND>
      <PROP NAME="Manufacturer"><PVAL>Sony</PVAL></PROP>
      <DVAL_ID ID="1001"/>
    </FILTER_AND>
    <FILTER_AND>
      <PROP NAME="Manufacturer"><PVAL>Aiwa</PVAL></PROP>
      <FILTER_NOT>
        <DVAL_ID ID="1002"/>
      </FILTER_NOT>
    </FILTER_AND>
    <PROP NAME="Manufacturer"><PVAL>Denon</PVAL></PROP>
  </FILTER_OR>
</FILTER>
Just as file-based expressions can be composed with query expressions, file expressions can also be composed within other file expressions. For example, the following query expression:
AND(FILTER(MyFilter),NOT(Manufacturer:Sony))
can be represented as a file-based expression using the following XML:
<FILTER>
  <FILTER_AND>
    <FILTER_NAME NAME="MyFilter"/>
    <FILTER_NOT>
       <PROP NAME="Manufacturer"><PVAL>Sony</PVAL></PROP>
    </FILTER_NOT>
  </FILTER_AND>
</FILTER>