[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: WML und Meta-HTML (fwd)
- From: Denis Barbier <nospam@thanx>
- Date: Wed, 19 Jan 2000 15:19:42 +0100 (CET)
On Wed, 19 Jan 2000, Tobias Oetiker wrote:
> We have some problems with the <protect> <preserve> tag.
Hi tobias,
> We try to use it when defining containers with meta html ... try the
> following script ... I think it should not work like this ...
>
> wml -r script
>
> # ---------- Silly test starts here----------------------------
[...]
> #---THe end
>
> why does this not return
>
> Var title=Perpetuum Mobile
Because Meta-HTML 5.09 does not evaluate attributes when function is called.
When you type
<foo bar=<get-var bar>>
then %attributes is set to "bar=<get-var bar>". The <preserve> tag
resets the variable, and so "bar=" is printed.
In the ChangeLog, i mentioned i had to hack it to restore previous
behaviour, i.e. attributes are evalled when the function is called, but
obviously this does not work.
Here are some workarounds:
a) do not use identical attribute names (silly advice, no?)
b) do not use attributes like
title="<get-var title>"
(this is a little bit more relevant).
# ---------- beginning of working example
#use wml::std::tags
<define-tag link2>
<preserve title>
<set-var %attributes>
Var title=<get-var title>
<restore title>
</define-tag>
<define-tag link1>
<preserve alttitle>
<set-var %attributes>
<link2 title="<get-var alttitle>">
<restore alttitle>
</define-tag>
<define-tag project>
<preserve title>
<set-var %attributes>
<link1 alttitle="<get-var title>">
<restore title>
</define-tag>
<project title="Perpetuum Mobile">
# ---------- end of example
c) replace
<define-tag link1>
<preserve title>
<set-var %attributes>
Var title=<get-var title>
<restore title>
</define-tag>
by
<define-tag link1>
<preserve title>
<set-var %xbody>
Var title=<get-var title>
<restore title>
</define-tag>
As you can see, i do not know exactly how to fix this bug.
This was one of the reasons (lack of documentation on the argument
evaluation process) why i decided to leave Meta-HTML and to write my own
macro processor ; this problem will vanish in next release.
--
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