|
Subject: RE: ifollow question From: Avi Kivity <Avi@xxxxxxxxxxxxx> Date: Thu, 11 Feb 1999 15:16:11 +0200 |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: ifollow question, Toby Speight | Thread | RE: ifollow question+Solution, Pawson, David |
| ifollow question, Pawson, David | Date | Re: ifollow question, Toby Speight |
| Month |