Re: (dsssl) DSSSL engines for ASCII output

Subject: Re: (dsssl) DSSSL engines for ASCII output
From: "John R. Sheets" <dusk@xxxxxxxxxxxxx>
Date: Thu, 3 May 2001 10:02:33 -0500
On Apr 18, 2001, "John R. Sheets" <dusk@xxxxxxxxxxxxx> wrote:
> The one thing I couldn't get to work is child node processing inside
> those paragraphs.  I used (data (current-node)) to grab the <para>
> contents, which slurps up child text without processing it.  For first
> time usage of names in screenplays, you want to display them in ALL
> CAPS.  I got this working with the tex backend, but can't figure out
> how to capitalize things before (data ...) grabs it.  Would that have
> to take place in the transformation phase, or would it be possible to
> hack something together in the style phase?  Could I force processing
> of (PARA NAME) inside the construction rule of (PARA), _before_ the
> call to (data ...)?

FYI, I finally got this working.  I ended up using a modification of
the (ndl->string) sample procedure in grove.dsl, in the tutorial by
Markus Reinsch, at:

It iterates through the (current-node) list manually.  Here's what it
looks like:

;; Parse through paragraph node-list and manually capitalize
;; sub-elements.
(define (process-para #!optional (ndl (current-node)))
   ((not ndl) #f)
   ((node-list-empty? ndl) "")
    (let ((node (node-list-first ndl)))
       (case (node-property 'class-name node)
         ;; Process child elements
          (process-para (node-property 'content node)))
         ;; Process character data
          (if (or
               ;; Always capitalize embedded NAME and SOUND elements
               (ancestor-child-number "NAME" node)
               (ancestor-child-number "SOUND" node)
              (case-fold-up (data node))
              (data node))
       (process-para (node-list-rest ndl)))

Works great!  Thanks Markus!



                   Writing GNOME Applications

 DSSSList info and archive:

Current Thread