Processors in Capaweb.pm


Capaweb 

Webber processor, version 1.0
Extracts Webber variables from tagged data (HTML, XML,...).
This progran must run inside Webber.
It modifies any Webber variable, as defined below.

Capaweb should be used as (one of) the first pre-processor(s).

Capaweb uses the following Webber variables:

 #wbbSource:       The source file to be used for variable extraction.
 #capaweb.VARNAME: Where VARNAME is the name of a Webber variable. Depending
                   on the value of the variable, Capaweb assigns a value for
                   VARNAME taken from the contents of the source file.
The value of a Capaweb variable has to comply to the following format:
  StartTag EndTag ['<'ListOfFlags'>']
Where:
 * StartTag is the tag that marks the beginning of the value to be assigned
   to VARNAME.
 * EndTag is the tag that marks the end of the value to be assigned to
   VARNAME.
 * ListOfFlags is an optional (comma separted) list of flags that control
   the behavior of Capaweb when extracting the value for VARNAME.
   Supported flags are:
   * keep: By default, tags identified by StartTag and EndTag are not included
     into VARNAME. If the 'keep' flag is used, these tags are included.
   * multi: Directs Capaweb to extract multiple values for VARNAME. This means
     that the value of VARNAME will be an expression suitable for building
     an array by means of an 'eval' statement.
   * span: Since value extraction performed by Capaweb is done by means
     of regular expressions, if this flag is used the regular expression will
     be a 'greedy' one.

For example, to assign the value of the body of an HTML page to #wbbIn, the
following syntax can be used:
 #capaweb.wbbIn= <BODY> </BODY> <span>
And to assign to #hd an expression that can be used to assign (by 'eval')
to an array the values of the contents inside the tags <i> and </i>
(including the tags themselves):
 #capaweb.hd= <i> </i> <multi,keep>