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

Why does <set-var %body> not work?



Hi!

I just encountered a little problem, and I'm not really understanding,
why it appeared. I used 

<set-var DESTINATION="/fnord/"
	 TITLE="example"
	 BASE="foobar"
	 SUFFIX="html"
	 DESC="Example">

as meta data section in my WML files. Now I tried to make it look a
little bit easier to novices:

<CONFIGURATION>
	DESTINATION="/fnord/"
	TITLE="example"
	BASE="foobar"
	SUFFIX="html"
	DESC="Example"
</CONFIGURATION>

and wrote the follwoing macro:

<define-tag CONFIGURATION endtag=required>\
<set-var %body>\
</define-tag>

But it didn't work, so I tried

<define-tag CONFIGURATION endtag=required>\
<set-var <attributes-quote %body>>\
</define-tag>

which didn't work either. Both didn't set the variables as one might
think. The debug output always says, that there are only 2 attributes
to set-var and shows Ctrl-Es instead of the double quotes like this:

trace: -1- <set-var
        DESTINATION=^E/fnord/^E
	TITLE=^Eexample^E
	BASE=^Efoobar^E
	SUFFIX=^Ehtml^E
	DESC=^EExample^E 
> -> 2 args

It seems as if 

<define-tag CONFIGURATION endtag=required>\
<set-var %body>\
</define-tag>

is always equivalent to

<define-tag CONFIGURATION endtag=required>\
<set-var "%body">\
</define-tag>

BTW: Even splitting %body manually via <foreach> didn't work:

<define-tag CONFIGURATION endtag=required>\
<set-var array="%body">;;; Works
<foreach x array>;;; Works
	Setting <get-var <attributes-quote x>>...;;; Works
	<set-var key=<match <get-var <attributes-quote x>> "=.*$" action=delete>>
	<set-var val=<match <get-var <attributes-quote x>> "^[^=]+=" action=delete>>
		The key is <get-var key>;;; Works
		The value is <get-var val>;;; Works
	<set-var <get-var key>=<get-var val>>;;; Works not
	<set-var <group <get-var key>=<get-var val>>>;;; Works not
	<set-var <attributes-quote <get-var key>=<get-var val>>>;;; Works not
</foreach>
</define-tag>

What I'm doing wrong? Why can't I use %body like use %attributes? Is
there something about <set-var>'s arguments parsing that isn't written
in the documentation. (Oh, and BTW I'm still running WML 2.0.4, but
there was nothing regarding my problem in the ChangeLog nor the FAQ...
:-)

And now the final question: Is there a workaround? :-)

		Regards, Axel
-- 
Axel Beckert - abe@cs.uni-sb.de - http://abe.home.pages.de/
Student of Computer Science, University of Saarland (Germany)
Artificial Intelligence Laboratory (AI Lab), Prof. Dr. W. Wahlster;
WWW-Administrator IBFI Schloss Dagstuhl; Students Representative
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com