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

Attributes / variables delimiters



Hello,

What could I use to delimit tag attributes when the content of those
attributes is rather complicated and already contain spaces, double
quotes, equal signs, language slices...? 

So far I am using double quotes (<MYTAG attr1="stuff" attr2="other
stuff">), but I think it would make things easier if I could switch to
some character not used elsewhere. I have a page using a tag with rather
complicated attributes and nested stuff which does not compile,
certainly because some attributes don't go through set-var correctly.

I tried using <attributes-quote %attributes> to keep the double quotes
around, but that does not work within set-var:

toto.wml:
  <define-tag not-quoted>
  $attributes: %attributes
  <set-var %attributes>
  $foo1: <get-var foo1>
  $bar1: <get-var bar1>
  </define-tag>
  
  <define-tag quoted>
  $attributes-quote: <attributes-quote %attributes>
  <set-var <attributes-quote %attributes>>
  $foo2: <get-var foo2>
  $bar2: <get-var bar2>
  </define-tag>
  
  <not-quoted 
  foo1="foo"
  bar1="bar">
  
  <quoted 
  foo2="foo"
  bar2="bar">

output:
$attributes: foo1=foo bar1=bar
$foo1: foo
$bar1: bar
$attributes-quote: foo2="foo" bar2="bar"
$foo2: "foo" bar2="bar"
$bar2:

The foo2 and bar2 variables don't get defined correctly.


Sincerely,

--
Ghislaine Labouret, Network security consultant
Hervé Schauer Consultants (HSC) - http://www.hsc.fr/
Phone (+33)-141-409-700 - Fax (+33)-141-409-709
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com