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

Re: Slicing and not-slicing but using the same template(s).

Jan Holler wrote:
> <snip>

> suppose i want to make decisions based on the contents of
> the variable:
> (all the necessary includes and definitions for the use of
> slices are done)
> ..
> <if <if <string-eq <get-var foo> "francais">
> <set-var bar="true">
> <set-var bar="false">
> >
> #print it
> bar is: <get-var bar>

I needed something similar to this too - I then solved this problem
(without elegance) by defining a variable for the preprocessor on the
commandline. With this your example would look like

<if <string-eq "$(FOO)" "francais">
 <set-var bar="true">
 <set-var bar="false">

This works, because $(FOO) will be replaced in pass 1.
To create the slices, you would call "wml -DFOO='francais' ..." and "wml
-DFOO='something-else' ..." .

As I said, not very elegant but it works.

Andreas Hofmeister (see http://www.informatik.uni-freiburg.de/~hofmeist)

"I can do it in Quake, why not in real life ?"
				(Lan Solaris (Illiad))

Version: 3.12
GCS/IT d-- s--:>++: a C++ ULSC+++$ P+++ L+++ E+ W++ N+ o? !w--- !O !M--
PS++ PE-- Y+ PGP- t+ 5? X+ !R !tv b+ DI? D++ G e>+++ h(++) r% y+
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com