Documentation
Getting Started
New Features
Component Guide
Programming
    Language Guide
    Language Ref.
       General Design
       Lexical Structure
       Expressions
       Objects
       Methods
       Classes
       heitml Tags
          ? Tag
          assign Tag
          defautoclose Tag
          break Tag
          callenv Tag
          dbdatabase Tag
          dbquery Tag
          dbupdate Tag
          def Tag
          defclass Tag
          defbody Tag
          defenv Tag
          defhtml Tag
          defwysiwyg Tag
          for Tag
          forin Tag
          forsep Tag
          if Tag
          elsif Tag
          else Tag
          include Tag
          includeonce Tag
          inherit Tag
          let Tag
          mail Tag
          return Tag
          shell Tag
          while Tag
          writefile Tag
          \ Tag
       heitml Functions
       Database Access
       Global Variables
       Form Fields
       Server Variables
       Sessions
       heitml Syntax
    Component Ref.
    Class Library
    User Components
    Tryout Form
    Tutorial
    heitml 1
User Guide
Registration
Frame
    

defhtml Tag

Format: <defhtml >

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:

heitml input:
<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) >
resulting output:

(a=11, b=162753203, [2]=20090109)
(a="5+6", b="SrvTime", SrvDate="SrvDate")

(href=8, b=11)
(href="mydir/test", b=11)


This page was dynamically generated by heitml
© 1996-2009 H.E.I. All Rights Reserved