Syntax
|
<CARAVAN> Filter <property>
</CARAVAN>
|
Text
|
Filtering is needed to convert text strings on the fly as they are output. You can apply filter to replace a particular string with another string.
Caravan has a facility to filter the output using the filter statement. The filtering mechanism in caravan is a powerful and efficient way to convert data. The programmer can create custom filters and use them as needed.
Example, text documents sent to the browser or html sent to the console or encoding strings in urls.
Default filter is ON.
Note: Older versions used the keyword "mode" instead of "filter" which is still valid though less intuitive.
|
Sample
|
Example <HTML> <BODY> <CARAVAN> filter url // filter as url filter ignorecase filter assign // filter active during assignments filter "filtername" // resusable filter filter on // apply filter. filter off // stop applying filter filter "string"="replacement-string" filter var(string)=var(replacement-string) </CARAVAN> </BODY> </HTML>
Note: Please note that we have provided comments in the Examples to explain the code to you.
|
Quick Reference
|
|
Properties
|
on
off
ignorecase
output
url
assign
"filtername"
"string"="replacement-string"
|
Home
Back
|