Re: first apparition of an element

Subject: Re: first apparition of an element
From: christo@xxxxxxxxxxxxxxxxxx (Frank Christoph)
Date: Wed, 6 Aug 1997 18:16:35 +0900
> How to see if an element is the first of its type.
> For example i have:
> 
> <chapter>
> <title>This is the title</title>
> (<sub-title>this might the sub-title but is optional</sub-title>)
> <para>this is the first paragraph</para>
> <para>this is the second one</para>
> ...
> </chapter<
> 
> And i would like to treat the first paragraph in a diferent way. I can't
> use children-number because there might be one or two element before the
> first para.

child-number (which, I assume, is what you meant) should work because it only
counts elements with the same GI.  The problem is if you have:

<para>A</para>
<something-else></something-else>
<para>B</para>
<para>C</para>

I am not sure if child-number will count the para holding B as the first
child or not.  (I suspect the latter...)

-- FC

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


Current Thread