[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

[LONG] Last call for comments before WML 2.0.2



Hear hear,

WML 2.0.2 will be hopefully released next week.  It would be great
if it was intensively tested before this date.  There has been some
tests, of course, e.g. the whole WML website has been rebuilt with
wml-SNAP, but there are surely some nasty bugs hidden in files i do
not use.
During this amount of time, documentation will be updated.

Now some words about mp4h. Because most reported bugs show that new
parsing scheme is not well understood, i decided a quite conservative
way: mp4h is configured to mimic Meta-HTML as closely as possible,
and xhtml addicts can change its behaviour with some flags.
In newer versions, when it appears that documentation is clear enough,
default flags will be changed.

Here is a summary of all options. For each option, 2 alternatives are
explained, star shows current default behaviour.  A zero means the value
which will be default value later.  The other solution is accessible
through the -X flag of mp4h (and thus -W2,"-X nnn" flag of wml).

 a)  Unknown tags
    1) are not parsed. There is no need to worry about mixing HTML
       tags with Perl or other programming languages, but quoting
       is mandatory in attributes:
          <group <b>Hello</b>>
       must be written
          <group "<b>Hello</b>">
  * 0) are parsed. Now
          <group <b>Hello</b>>
       is valid but
          print '<img src="'. $file . '"';
          print " alt=\"".$alt.'"' if $alt;
          print '>';
       must be rewritten
          print '<*img src="'. $file . '"';
          print " alt=\"".$alt.'"' if $alt;
          print '>';
       The leading star prevents the 'img' tag from being parsed.

 b)  Unknown tags (useless with a.1)
  * 1) are simple tags.  Until now there was no way to tell WML whether
       HTML tags are simple or complex, so choosing this default will
       certainly break fewer pages.  But complex HTML tags must be quoted,
           <if 1 <b>Hello World!</b>>
       pri nts
           <b>Hello
    0) are complex tags
       This is the most logical choice, because tags are complex by
       default in XML. Simple HTML tags must have a trailing slash,
       as with XML. So we can write
           <if 1 <b>Hello World!</b>>
           <group
               <set-var foo=bar>
               <br/>
           >
       But we sometimes want to write a begin tag without its matching
       end tag. To do so, append a star to the tag name, it means that
       this is an HTML complex tag, but which is parsed as a simple tag:
           <navbar:header><table*><tr*></navbar:header>
           <navbar:footer></tr*></table*></navbar:footer>
       Note that leading and trailing stars are _not_ equivalent.

 c)  Trailing star in tag name
  * 0) acts as explained just above.
    1) has no special meaning.  This feature is surely useless.

 d)  Trailing slash in HTML tag attributes
  * 1) are removed
    0) are preserved.  Conformance to XHTML standard needs this option.

 e)  Backslashes in strings
  * 0) escape only 'n', 'r', 't', '"' and '\' characters.  With
       Meta-HTML we had to print backslahes twice, e.g.
           <subst-in-string "qwerty" "([a-z])" "\\1 ">
       When this flag is set, it is possible to write
           <subst-in-string "qwerty" "([a-z])" "\1 ">
       and in fact both forms do work.
    1) are removed as with printf, so "\1" is equivalent to "1"

 f)  Defined end tag which does not match begin tag
  * 1) close all previously begin tags. So
           <navbar:header><table><tr></navbar:header>
           <navbar:footer></tr></table></navbar:footer>
       is well parsed, because </navbar:header> closes <table>
       and <tr> HTML tags, even if (b.0) is set.
    0) are invalid.  This is the most strict syntax, and it eases
       debugging.

 g)  Warnings about bad nested tags
  * 1) are discarded
    0) are printed

 h)  Warnings about missing trailing slash in attributes
  * 1) are discarded
    0) are printed

It is possible to write templates which work well with any combination
of these flags.  But my priority is to provide a working WML package,
so i will focus on providing module files fitting current default mp4h
behaviour and (0) alternative of [a-f] cases.  Last 2 cases will be
processed later.

-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com