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

Re: [wml] [LONG][WML] Mp4h parsing: summary

On Sat, 3 Jun 2000, Tobias Oetiker wrote:

> note that there are still some browsers which will not like <br/>
> so one might want to writ <br*> as the * will get removed in later
> wml processing where as the <br/> will remain unchanged

I was speaking of pass 2 only, i.e. tag parsing.  Rendering may be
altered by other passes, e.g. wml_p7_htmlfix, wml itself, or a
post-processor like tidy.

> *>      When this tag cannot be parsed, it must be protected with a
> *>      leading star, which will make it fall into category 6.
> *>        document.write('<*img src="foo.png" alt="');
> *>        document.write(text+'">');
> here you protect the opeing < into not being interpreted as part of
> a tag, but if the whole combination happens inside another tag how
> do you protect the inner >
> eg
> <de: document.write('<*img src="foo.png" alt="');
>      document.write(text+'">');
> >                          ^          

Basically, an unwanted closing bracket is protected by quoting it.
This is very intereting, because we enter here the wonderful world of
  Rule 1: in attributes, quotes are used to group tokens.
  Rule 2: in other places, quotes have no special meaning

Rule 1 implies that we must define how to allow quotes within quotes.
In Meta-HTML and mp4h, escaping quotes is a solution. So your example
could be rewritten as
 <de: "document.write('<*img src=\"foo.png\" alt=\"');

But these escapes have many drawbracks (i will send a summary about
quoting later), and an alternative is to define <lb/> (left bracket),
<rb/> (right bracket) and <dq/> (double quotes), something like
   <define-tag lb><noexpand "<"></define-tag> and so on.

Your example becomes
 <de: document.write('<lb/>img src=<dq/>foo.png<dq/> alt=<dq/>');

This is a first thought, it needs work.


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