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

Re: Attributes / variables delimiters



On Wed, Sep 26, 2001 at 04:29:51PM +0200, Ghislaine Labouret wrote:
> 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:

Hi,

Mp4h gobbles double quotes in attributes, and the <attributes-quote>
only role is to put them back when you want to print HTML attributes.
So this is not the right tool here.

If mp4h is confused by long and complex constructs, it may be a bug in
your pages or in mp4h, and it would be nice to have your example to add
it to the mp4h torture suite ;)
Could you put some sources online which demonstrate this problem?

Maybe the easiest solution is to replace some attributes by container
tags, e.g.
  #   <auxvar> is to prevent name clash
  <define-tag auxvar>_x_%0</define-tag>
  <define-tag attr endtag="required" whitespace="delete">
    <preserve name>
    <set-var %attributes>
    <set-var <auxvar <get-var name>>=%body>
    <restore name>
  </define-tag>
  <define-tag get-attr whitespace="delete">
    <preserve name>
    <set-var %attributes>
    <get-var <auxvar <get-var name>>>
    <restore name>
  </define-tag>
  <define-tag mytag endtag="required">
    <preserve <auxvar attr1> <auxvar attr2>>
    %body
    Here attr1 is: <get-attr name=attr1>
    And  attr2 is: <get-attr name=attr2>
    <restore <auxvar attr1> <auxvar attr2>>
  </define-tag>
  <mytag>
    <attr name="attr1">
      blah " blah blah [E:x:]
    </attr>
    <attr name="attr2">
      blah blah blah
    </attr>
  </mytag>

-- 
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