Nodes and counting

Subject: Nodes and counting
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Tue, 30 Sep 1997 14:32:03 +0100

Given a DTD structure

Parent
   child1,
   child2*,
   child3*


I am trying to put a paragraph space-after, dependent on the number of
children actually there.
using

(element child1 (
   make paragraph
   use: para-style
space-after: (if (> (node-list-length (parent (current-node))) 2) 0pt
2em)
  (process-children)))

The intent is that if there are three elements under parent, I will have
0pt space after child1.
I always get a false from the 'if' statement. 

<question> Am I right in thinking that node-list-length (when all three
children are there in
a document instance) will be 3? </question>

[ What I really want is an  (if-exist (sibling "child2") test - Does one
exist? I.e. test for a sibling with
given name, to make me less dependent on the dtd structure.

Any help appreciated.

Regards, DaveP


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


Current Thread