defhtml Tag
Context:
defhtml must be used inside a def or defenv
tag (after a inherit tag if present).
Purpose:
The syntax of heitml user-defined tags is an extension of the HTML/XML syntax,
since arbitrary expressions are allowed as parameters.
When creating new pages this is fine, since tags with dynamic parameters can
be written very easily. However, if existing HTML code is reused, this might cause
problems.
heitml parses the calls of tags defined with defhtml in HTML compatibility
mode. This means according to the following syntax
Syntax: |
| | ActualParameterlist'::= | ( ParameterName [ = ( String | ( Expr ) ]) * .
|
- no positional parameters are allowed
- parameter values are interpreted as strings rather than expressions
- parameters without parameter value are interpreted as HTML-Bools
and pass their parameter name as value
- parameter values enclosed in brackets are interpreted as expressions (as
extension to HTML/XML)
It is a good idea to use defhtml for all redefined HTML tags.
Example:
To redefine the paragraph tag in a way that the following HTML code still works
defhtml is necessary:
<P ALIGN=CENTER>
Without the defhtml tag in the definition of the p tag, heitml
interprets CENTER as a variable.
The following example illustrates the differences of HTML and heitml parameter parsing.
Example:
input: | resulting output:
| <def myheitml @p ...>
<?p><br></def>
<def myhtml @p ...; defhtml>
<?p><br></def>
<myheitml a=5+6 b=SrvTime SrvDate>
<myhtml a=5+6 b=SrvTime SrvDate>
<let mydir=40; test=5><p>
<myheitml href=mydir/test b=(5+6) >
<myhtml href=mydir/test b=(5+6) >
|
(a=11, b=12608634, [2]=20241211)
(a="5+6", b="SrvTime", SrvDate="SrvDate")
(href=8, b=11)
(href="mydir/test", b=11)
|
This page was dynamically generated by the
web application development tool RADpage
of H.E.I.
Try the AJAX Article
(in German) on www.h-e-i.de.
© 1996-2024 H.E.I. All Rights Reserved.
|