RE: Transformation: data to attr val.

Subject: RE: Transformation: data to attr val.
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Sun, 11 Jul 1999 15:58:12 -0400
Hi David,

David said:
	Something was recently posted about this on the list.
[dgm>]  I recall seeing this post now but I did not understand it in context
to my issue. My apologies.  It is unfortunate that still much of the
technical stuff I read on the list goes right by me. I am on the first
plateau of the DSSSL learning curve.  Much credit goes to the OpenJade site
and especially the Markus Reinsch tutorial in getting me this far. However
learning a little Scheme goes a long way.
> `(("num" ,(data (current-node))))
[dgm>]  This resulted in the same error message. I don't see what the comma
is going to buy you. I'll go back and check the old post.

> (list (list "num" (data (current-node))))
[dgm>]  But this did the trick.

Didier says:
Don't apologize David, this is not so obvious if you are not used to scheme.
Yes indeed the second construct is OK. I do not know for the first
construct, I use the second one.

I also use Tony's macro to create my own destination document elements.

(define (make-element gi
		      #!optional (children (empty-sosofo))
		      #!rest attributes)
  (make element
    gi: gi
    attributes: (let loop ((attr-list attributes)
			   (result-list '()))
		  (if (null? attr-list)
		      result-list
		      (let ((name (car attr-list))
			    (value (cadr attr-list)))
			(if (and (string? name)
				 (string? value))
			    (append
			     (list (list name value))
			     (loop (cddr attr-list)
				   result-list))
			    (loop (cddr attr-list)
				  result-list)))))
    children))

and use it like

(declare-flow-object-macro target
  ((attribute1 #f)
   (attribute2 #f)
   #!contents children)
  (make-element "target" children
		"attribute1" attribute1 "attribute2" attribute2))

and use it like

(element source
    (make target
		attribute1: "value1"
		attribute2: "value2"
    )
)

This way the target document'elements are perceived as flow objects. to
transform from a doc type to an other one you just "make" the target
elements.

I can to write a bit about this powerful feature of OpenJade. I think that
Tony wrote a Perl script that automatically creates the library from a
template DTD or template target document. Tony, do I remember well?

David, keep going.


regards
Didier PH Martin
mailto:martind@xxxxxxxxxxxxx
http://www.netfolder.com


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


Current Thread