|define-drs-condition-extractor||element-name class-name (element) &body body|
extract-drs-condition-from-node kind element => drs-condition
kind --- a class, or a symbol that names a class
node --- a DOM element
Extract-drs-condition-from-element builds a drs-condition, specifically of type kind from element. How this particular process is carried out depends on the kind of object being constructed.
Extract-drs-condition-from-element should usually not be called by user code directly, but rather by drs-condition-from-element . Similarly, it is not expected that extract-condition-from-element methods will be defined directly, but rather using define-drs-condition-extractor .
drs-condition-from-node node => drs-condition
element --- a DOM element
drs-condition --- a drs-condition
Extracts a drs-condition from element. The type of drs-condition to build is determined based on the element's tag name (based on a mapping established by define-drs-condition-extractor ) and then extract-drs-condition-from-element is applied to the type the element. The resulting drs-condition is returned.
If the element's tag name does not correspond to a class, an error is signalled.
extract-drs-conditions-from-node-list node-list => conditions
node-list --- a DOM node list
conditions --- a list of drs-condition
Returns a list of drs-conditions extracted from the DOM element nodes in node list. Conditions are extracted from element nodes using drs-condition-from-element .
parse-drsxml blob => drs
blob --- a string (or other suitable input for cxml:parse)
drs --- a drs object
parse-drsxml parses the XML representation of a DRS in the format produced by the APE Webservice. The XML representation is parsed by Closure XML , particularly using the function cxml:parse . cxml:parse can accept strings, pathnames, octet vectors or streams.
define-drs-condition-extractor element-name class-name (element) [[declaration* | documentation ]] form*
element-name --- a string
class-name --- a symbol or class, not evaluated
element --- a variable
define-drs-condition-extractor associates element-name with class-name (via install-element-name-drs-condition-type-mapping ), and defines a method on extract-drs-condition-from-element whose first parameter is specialized with (eql class-name), and whose second parameter is non-specialized, and named node. Declarations, documentation, and forms appear as the body of the method. The body should construct and return a drs-condition of type class-name from the element.