transferring attributes

Subject: transferring attributes
From: J-P Theberge <yesod@xxxxxxx>
Date: 09 Dec 1998 14:58:44 -0500
Hi,

Converting XML -> html with Jade.

How can I have an attribute transfered as-is if it exists but not if
it dont?

ex:

<tagxml attribute="value"> ==> <taghtml attribute="value">

and

<tagxml> ==> <taghtml>

It seem simple but so far everything I try fail

this is my last try:

(define (default-attrib attrib def)
        (list attrib (or (attribute-string attrib) def)))

(define (if-attrib-exist attrib)
        (let ((a (attribute-string attrib)))
          (if a (list attrib a))))

(make element gi: "body" 
      attributes: (list (if-attrib-exist "background") 
                        (default-attrib "bgcolor" "white")
                        (default-attrib "text" "black")
                        (default-attrib "link" "blue")
                        (default-attrib "vlink" "purple")
                        (default-attrib "alink" "red"))
     	
The default-attrib is ok but the if-attrib-exist fail.

--
JP Theberge
tech@xxxxxxxxxxxxxxx

 



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


Current Thread