Re: attributes in SGML to SGML

Subject: Re: attributes in SGML to SGML
From: Toby Speight <Toby.Speight@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: 21 Jul 1999 18:21:34 +0100
Jany> Jany Quintard <URL:mailto:quintard.j@xxxxxx>

0> In article
0> <Pine.LNX.3.96.990721182303.7947e-100000@xxxxxxxxxxxxxxxxxxxxxxxxx>,
0> Jany wrote:

Jany> So this is easy to convert with :
Jany> (element Elem
Jany>     (make element gi: "element"
Jany>           attributes: (list (list "xxxx" (attribute-string "AAAA"))
Jany>                             (list "yyyy" (attribute-string "BBBB")))
Jany>     (process-children)))
Jany>
Jany> But when AAAA or BBBB is not present, I get an error.
Jany> So. I tried to condition the list with things like :
Jany>
Jany> attributes:
Jany>   (list
Jany>     (if (attribute-string "AAAA") (list "xxxx" (attribute-string "AAAA"))
Jany>                                   list_empty)
Jany>     (if (attribute-string "BBBB") (list "yyyy" (attribute-string "BBBB"))
Jany>                                   list_empty))
Jany>
Jany> The problem is what to use for list_empty ?
Jany> () gives an error
Jany> ( "" "" ) works but seems rather silly in any output other than
Jany> HTML.

I use (append), something like this:

;;untested
  attributes:
    (append
      (if (attribute-string "AAAA")
          (list (list "xxxx" (attribute-string "AAAA")))
        '())
      (if (attribute-string "BBBB")
          (list (list "yyyy" (attribute-string "BBBB")))
        '()))

-- 


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread