A Rule based framework for invoking ICAP services is proposed in [4] The rules are to be specified as XML data (using the IRML specification).
The following is the DTD for IRML:
<!ELEMENT rulemodule (owner, protocol, rule+)>
<!ELEMENT owner
(name, id)>
<!ELEMENT name
(#PCDATA)>
<!ELEMENT id
(#PCDATA)>
<!ELEMENT protocol (#PCDATA)>
<!ELEMENT rule
(property | action)+>
<!ELEMENT property (property
| action)+>
<!ELEMENT action
(#PCDATA)>
<!ATTLIST owner
class (content provider |
access provider | client) #REQUIRED>
<!ATTLIST rule
processing-point (1|2|3|4) #REQUIRED>
<!ATTLIST property name
CDATA #REQUIRED>
<!ATTLIST property matches
CDATA #REQUIRED>
<!ATTLIST property case-sensitive
(yes|no) #DEFAULT "no">
An example IRML file is shown below:
<?xml version="1.0"?>
<rulemodule>
# Rule for sending the right GIF (For pocket PC)
# Note the nested condition checks
<owner class="ISP">
<name>Geetha Manjunath</name>
<id>23242</id>
</owner>
<protocol>http</protocol>
<rule processing-point="4">
<property name="User-Agent" matches="*CE*">
<property name="Request-Path" matches=".*hotspot_long.gif">
<action>WinCEImage?</action>
</property>
</property>
</rule>
# Rule for translating to French based on Client Id
<owner class="client">
<name> Venky </name>
<id>23242</id>
</owner>
<protocol>http</protocol>
<rule processing-point="4">
<property name="Client-Id" matches=".*@hpl.hp.com">
<action>translatePl</action>
</property>
</rule>
</rulemodule>
This
project is sponsored by Hewlett Packard Labs.