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

Re: define-container, preserve and -Dvarname



On Fri, 13 Aug 1999, Denis Barbier wrote:

>On Wed, 11 Aug 1999, Davor Cengija wrote:
>
>> 	I have a <define-container> tag which can have three values for an
>> 	attribute: first is the default, hardcoded; the second is per-page
>> 	default, called with -D option in #!wml -Dvarname=value and the third one is the
>> 	specified value for each call.
>[snip long description of this problem]
>
>Hi Davor,
>
>i don't have time to investigate too much your problem, sorry, but i'm
>sure there is a solution. Did you have a close look at the wml_p1_ipp
>manpage ?

	Obviously not too good:-) but...
>
>Below is an example, i'm sure you can easily adapt it to your own needs:
>(not tested, may contain bugs)
>
><define-container tbl>
><preserve bgcolor>
><preserve title>
><set-var %attributes>
>#  this variable will be ``red'' if no -Dbgcolor attribute is set,
>#  otherwise it takes this value.
><ifeq "<get-var bgcolor>" "" <set-var bgcolor="$(bgcolor:-red)">>

	... that solves the problem, thanks! Reading the wml_p1_ipp
	manpage I also found that... 
>#  everything below is unchanged
><ifeq "<get-var title>" "" <set-var title="YOU MUST HAVE A TITLE!!">>

	... here I can state title="$(title:?[You must have a title])"

	<preserve> and <restore> now act as they should.

	Thanks for the help.
	
	Davor

-- 
      v
Davor Cengija
davor@linuxfan.com
===================================
"Please allow 30 days for delivery"
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com