Directory Services |
The definition of the search filter query syntax for DSML V2 is part of the DSML V2 XML schema specification. The following syntax is derived from LDAP search filter strings as defined in RFC 2254, but is significantly different.
The following code examples show typical LDAP search strings and their DSML V2 equivalents.
LDAP Filter
(objectclass=*)
DSML V2 Filter
<filter> <present name="objectclass" /> </filter>
LDAP Filter
(&(objectCategory=contact)(sn=J*))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectCategory"> <value>contact</value> </equalityMatch> <substrings name="sn"> <initial>J</initial> </substrings> </and> </filter>
LDAP Filter
(&(objectCategory=organizationalUnit)(description=H\2aQ))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectCategory"> <value>organizationalUnit</value> </equalityMatch> <equalityMatch name="description"> <value>H*Q</value> </equalityMatch> </and> </filter>
LDAP Filter
(&(objectClass=inetorgperson)(roomnumber>=2000)(roomnumber<=3000))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectClass"> <value>inetorgperson</value> </equalityMatch> <greaterOrEqual name="roomnumber"> <value>2000</value> </greaterOrEqual> <lessOrEqual name="roomnumber"> <value>3000</value> </lessOrEqual> </and> </filter>
LDAP Filter
(!(assistant=*))
DSML V2 Filter
<filter> <not> <present name="assistant" /> </not> </filter>
LDAP Filter
(&(objectCategory=person)(objectClass=user)(departmentNo=101)(!(assistant=*)))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectCategory"> <value>person</value> </equalityMatch> <equalityMatch name="objectClass"> <value>user</value> </equalityMatch> <equalityMatch name="departmentNo"> <value>101</value> </equalityMatch> <not> <present name="assistant" /> </not> </and> </filter>
LDAP Filter
(&(objectClass=organizationalUnit)(description=<Marketing-Central>))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectClass"> <value>organizationalUnit</value> </equalityMatch> <equalityMatch name="description"> <value><Marketing-Central></value> </equalityMatch> </and> </filter>
LDAP Filter
(&(objectClass=organizationalUnit)(description=\28Marketing-Central\29))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectClass"> value>organizationalUnit</value> </equalityMatch> <equalityMatch name="description"> <value>(Marketing-Central)</value> </equalityMatch> </and> </filter>
This value is a three-byte binary value, where the first byte is the ASCII value of 'a', the second byte is 0x0 and the third is 'a' , that is, {'a', 0x0, 'a'}.
LDAP Filter
(bin=a\00a)
DSML V2 Filter
<filter> <equalityMatch name="bin"> <value xsi:type="xsd:base64Binary">YQBh</value> </equalityMatch> </filter>
LDAP Filter
(&(objectCategory=attributeSchema)(systemFlags:1.2.840.113556.1.4.804:=1))
DSML V2 Filter
<filter> <and> <equalityMatch name="objectCategory"> <value>attributeSchema</value> </equalityMatch> <extensibleMatch name="systemFlags" matchingRule="1.2.840.113556.1.4.804"> <value>1</value> </extensibleMatch> </and> </filter>