Subject: Re: read-entity, is there any example or use explication? From: Norman Walsh <ndw@xxxxxxxxxx> Date: Thu, 3 Sep 1998 06:40:04 -0400 |
/ miguel.mata@xxxxxxxxxx was heard to say: | Hi, I don't know how can I use read-entity to access datas from another | file, do you know it?, or have you any example? From my DocBook stylesheets, v1.13: (define ($include$ fileref) (let* (;; Yes, the next line really ends with "#", "\", "[newline]" (newline #\ ) (file-content (read-entity fileref)) (file-charlist (string->list file-content)) (file-length (length file-charlist)) (file-headlist (list-head file-charlist (- file-length 1))) (file-taillist (list-tail file-charlist (- file-length 1))) ;; If the last char is a newline, drop it, otherwise print it... (content (if (equal? newline (car file-taillist)) (list->string file-headlist) file-content))) (make sequence (literal content)))) All that hackery about the last character is to avoid an extra linefeed, it's unnecessary if you're going to use the data somehow (i.e. in some SGMLish way) and probably unnecessary if you're not dropping the data into an asis environment. Cheers, norm -- Norman Walsh <ndw@xxxxxxxxxx> | Whatever you do may seem http://nwalsh.com/ | insignificant, but it is most | important that you do it.--Ghandi DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
read-entity, is there any example o, miguel . mata | Thread | Re: read-entity, is there any examp, James Clark |
Re: make page-float and span:, Sebastian Rahtz | Date | Re: read-entity, is there any examp, James Clark |
Month |