RE: ifollow question+Solution

Subject: RE: ifollow question+Solution
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Thu, 11 Feb 1999 13:56:41 -0000
Many thanks Avi.
that did it.

regards, DaveP



-----Original Message-----
From: Avi Kivity [mailto:Avi@xxxxxxxxxxxxx]
Sent: 11 February 1999 13:16
To: 'dssslist@xxxxxxxxxxxxxxxx'
Subject: RE: ifollow question


On Thursday, February 11, 1999 14:19, Pawson, David
[SMTP:DPawson@xxxxxxxxxxx] wrote:
> In a drama dtd, 
> I want to process the <speaker><speech> elements, both children of
> <act>
> to produce
> speaker: speech .......
> as a single para.
> 
> I'm trying with ifollow.
> 
> (element speaker
>   (make paragraph
>       (make sequence
>       (process-children)
>       (literal ": ")
>       (if (string=? (gi (ifollow (current-node))) "speech") ; tried
>       "SPEECH"
> as well.
>       (process-node-list
>        (ifollow (current-node)))
>       (literal"Nope")    ;; ? debug??
>       ))))
> (element speech (empty-sosofo))
> 
> 
> I'm not getting any output, despite the sibling speech being there
> in the source.

You specified that 'speech' is rendered as an (empty-sosofo), and that is
what you got. Using (process-node-list) is no different than the natural
firing of element rules by the dsssl engine.

What you want to do is differentiate between 'natural' processing and the
processing done by (process-node-list). This is done using dsssl modes:

> (element speaker
>   (make paragraph
>       (make sequence
>       (process-children)
>       (literal ": ")
>       (if (string=? (gi (ifollow (current-node))) "speech") ; tried
>       "SPEECH"
> as well.
         (with-mode speech    ;change processing rules for a moment
>         (process-node-list
>          (ifollow (current-node)))
         )                             ; back to normal
>       (literal"Nope")    ;; ? debug??
>       ))))
> (element speech (empty-sosofo))

(mode speech
    (element speech (process-children))
)

Now there are two rules for speech - a general rule, and a specific rule for
the (process-node-list) call.

> 
> As usual, I don't understand the guidelines / digest
> <quote>
> Returns the mapping over nl of the function on a node that returns
> the
> immediately following sibling of the node, if any. This
> could be defined as follows:snip </quote>

Legalese for 'immediately following siblings of each node in the node-list
nl, if they exist'. 

> 
> the bit I focussed on was 'returns the immediately following
> sibling.
> 
> I do want the immediate following sibling, am I using the right
> procedure?

Yes, and you got it, you just didn't render it.

> 
> Any help appreciated.
> 
> regards, daveP
> 
HTH, Avi



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


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


Current Thread