Re: attributes in SGML to SGML

Subject: Re: attributes in SGML to SGML
From: Alexander Taranov <tay@xxxxxxxxxx>
Date: Mon, 26 Jul 1999 15:59:38 +0400 (MSD)
Jany Quintard writes:
 > On Wed, 21 Jul 1999, Brandon Ibach wrote:
 > 
 > > Quoting Jany Quintard <quintard.j@xxxxxx>:
 > > > I am having a little problem with the conversion of attributes from SGML
 > > > DTD1 to SGML DTD2
 > > > ...
 > > > Does anyone know of a better solution ?
 > > > 
 > > Hi, Jany...
 > >    While the solutions given by Dan and Toby should do the trick, I
 > > think a slicker approach would be to use the copy-attributes function
 > > .../...
 > >    Let me know if you need some help putting this together.
 > Well, I am afraid I do.
 > I had time this morning and wanted to build this function, thinking it was
 > a good exercise.  I nearly got it, but due to some reason (probably my lack
 > of skill), I can't get it to work properly.
 > Here is the style-sheet :
 > 
 > (declare-flow-object-class element
 >   "UNREGISTERED::James Clark//Flow Object Class::element")
 > (define debug
 >   (external-procedure "UNREGISTERED::James Clark//Procedure::debug"))
 > 
 > (define (copy-matching-attributes #!optional (nd (current-node)))
 >   (let loop ( (atts (named-node-list-names (attributes (current-node))))
 >               (attr-pairs (list (list "Class" "class")
 >                                 (list "ID" "name")))
 >               (result '())
 >             )
 >     (if (null? attr-pairs)
 >         result
 >         ( loop
 >             atts
 >             (cdr attr-pairs)
 >             (if 
	        (and ;; you have IMPLIED attributes,
                     ;; which names are on atts list,
                     ;; but they have no explicit value,
		     ;; so check it ! 
	           (member (car (car attr-pairs)) atts)
		   (attribute-string (car (car attr-pairs)) nd))	
 >                (append result
 >                           (list
 >                             (list (car (cdr (car attr-pairs)))
 >                             (attribute-string (car (car attr-pairs)) nd))))
 >                 result)))))
 > 
 > 
 > (default 
 >   (sosofo-append
	;; literal makes a sosofo from string, not list which is 
        ;; value of debug here
 >     (literal (debug (copy-matching-attributes)))
 >     (make element
 >           attributes: (copy-matching-attributes)
 >       (process-children))))
 > 
 > 
 > - attr-pairs is is the list of list of names of attributes
 > - result is the resulting list of lists of two strings to be given to
 >   attributes.
 > 
 > It seems that I can't get the value of the attributes, the call to
 > attribute-string returning false, according to the debug :
 > jade:/xo/vpp/dsssl-dev/provi.dsl:41:25:E: 1st argument for primitive
 > "literal" of wrong type: "(("class" #f) ("name" #f))" not a string
 > 
 > The solution is probably obvious, bust I can't manage to see it :-(
 > 
 > TIA. Jany.
 > 
 > 
 > 
 > 
 >  DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist
 > 


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


Current Thread