Re: arguements

Subject: Re: arguements
From: Chris Maden <crism@xxxxxxx>
Date: Tue, 16 Dec 1997 16:22:36 -0500
[Andre Linares]
> I have this bit of code that I am getting errors on.  I am using the
> IF to eval certain <TEXT>'s parents attributes
> 
> (element TEXT
>   (if (string=? (attribute-string "TYPE" (parent (current-node)))  "LIST:NONE")
>       (make paragraph       if it equals, increase start indentation
>         start-indent: 20pt  
>         (process-children)
>       )
>       (process-children)        else just output as usual
>   )
> )
> 
> Jade is giving me error mesages when I run it:
>     1st argument for primitive "string=?" of wrong type: "#f" not a
>     string

If the attribute in question is #IMPLIED, then (attribute-string)
returns #f.  In cases like this, I usually do something like

(element TEXT
	 (let ((type-attr (attribute-string "TYPE"
					    (parent (current-node)))))
	   (if type-attr
	       (if (string=? type-attr
			     "LIST:NONE")
		   (make paragraph
			 start-indent: 20pt
			 (process-children))
		   (process-children))
	       (process-children))))

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


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


Current Thread
  • arguements
    • LINARESA - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA09021Tue, 16 Dec 1997 16:10:43 -0500 (EST)
      • Chris Maden - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA09135Tue, 16 Dec 1997 16:17:27 -0500 (EST) <=