REXXTAGS.org :: | XML tags: tag procedures and tag results |
Tags
REXXTAGS is a REXX Server Pages compiler. REXX Server Pages (RSP) are normal HTML pages extended with features similar to those found in Java Server Pages (JSP) or Active Server Pages: scriptlets, expressions, directives, and XML tags. XML tags are described in this document; other features are described elsewhere.
RSP Tags are XML-like tags, in the form:
If needed, parameters may span multiple lines:
If the tag has no body, the short form can also be used:
RSP Tags should, in principle, conform to the XML syntax. The REXXTAGS compiler, however, does not enforce strict XML syntax compliance, and allows arbitrary parameter lists, like in the following example:
Tag parameters are passed verbatim (after substituting line feeds for single blanks) to the tag procedure (see below); a tag procedure may implement XML syntax compliance for the parameter list, if needed.
The tag procedure
RSP tag semantics are implemented by REXXTAGS tag procedures. A tag procedure is a particular form of REXX procedure which conforms to the REXXTAGS API. Here's the simplest form of a tag procedure:
Another form, to be preferred if the tag procedure needs to do calculations, if the following:
The tag procedure is called once with Arg(1) = 'START' at the point where the start tag is encountered, and once with Arg(1) = 'END' when the end tag is encountered. If the short form <prefix:tag [parms]> is used, two calls are generated, one with Arg(1) = 'START' and one with Arg(1) = 'END'.
The more general form of a tag procedure is as follows:
Tag results
A tag procedure may return HTML code and/or REXX code as the result of the 'START', 'BODY' and 'END' calls. HTML code will be substituted for the start tag (resp. tag body, end tag) in the HTML file sent to the user. If a tag wants to return multiple HTML lines, it may do so by separating lines with a '00'x character:
A tag procedure may also return one or more REXX code blocks (returned scriptlets), which will be interpreted by the REXXTAGS compiler at the point of the page where the corresponding call is made. REXX code must be delimited between a single line which contains the separator '<%' and a single line which contains the separator '%>':
Please note that returned scriptlets are interpreted by REXX, and consequently they can not contain labels or procedures. A tag may return HTML code only, REXX code only, HTML code and REXX code, or nothing (Return "").
Parameter passing, body processing, variable sharing and special calls
TBD; see also the preliminary specs.
/specs/tags.html Last update: 16/06/03 at 12:40 |