Subject: Re: From flat structure to a tree From: Brandon Ibach <bibach@xxxxxxxxxxxxxx> Date: Tue, 8 Feb 2000 16:46:18 -0600 |
Quoting Jany Quintard <quintard.j@xxxxxx>: > Very good. This is *much* simpler than the code I wrote when trying to > implement Holgers suggestion (my poor twisted mind). > I wonder if the default rule could be written this way : > > (default (let ((h (hlev (current-node)))) > (if h (make element gi: "DIV" > (process-node-list (getkids (current-node) h))) > (make element)))) > > This should do all element processing, provided a wholesome > (copy-attributes) function. (I have one) > Yes, this should work, but you'd need another (make element) after "DIV", lest you lose the header. > There is a last problem which prevents the code to work : > On heading elements, the (getkids) function calls (hlev) and I get > systematically an error when trying to get the gi of the node. In my test > file, this is a <p>. But the (gi) returns #f > There is something (or many things) I do not understand. > Hmm... not sure what's happening here. Perhaps you could try replacing the (string-ref) calls in the code with calls to: (define sref (lambda (s k) (and (< k (string-length s)) (string-ref s k)))) If that doesn't work, feel free to email me your instance, and I'll see if I can track down the problem. -Brandon :) DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: From flat structure to a tree, Jany Quintard | Thread | Re: From flat structure to a tree, Jany Quintard |
Re: From flat structure to a tree, Jany Quintard | Date | Re: From flat structure to a tree, Jany Quintard |
Month |