This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Counting only some children of a node - nevermind!
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Re: Counting only some children of a node - nevermind!
- From: Christian Cäsar <caesar at mpdigital dot de>
- Date: Thu, 23 Aug 2001 13:03:24 +0200
- References: <3B84E1E6.76344D7A@mpdigital.de>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello list,
now I've found it. :-p
I used
count(descendant::Neutral)
Almost too easy...
Greetings,
Christian Caesar
Christian Cäsar schrieb:
>
> Hello list,
>
> consider this XML source:
>
> <somenode>
> <Tabelle>
> <Spalte>
> <Text>
> <Neutral>sometext</Neutral>
> </Text>
> </Spalte>
> <Spalte>
> <Text>
> <Neutral>sometext</Neutral>
> </Text>
> </Spalte>
> <Spalte>
> <Text/>
> </Spalte>
> </Tabelle>
> </somenode>
>
> Some 'Text' Elements may have a child and values, others don't. I want
> to count the number of 'Spalte' Elements that have 'Text' elements with
> a child. The actual XML has more 'Spalte' elements.
>
> I tried
>
> count(descendant::Tabelle/Spalte[/Text/*]) and
> count(descendant::Tabellenheader/Spalte[/Text/text()])
>
> but that was (obviously) wrong (I got 0), as is
>
> count(descendant::Tabelle/Spalte)
>
> that got me (number of 'Spalte' Elements). I know I must be
> quite close to the solution, but I seem not to be able to see it.
>
> If it is important: I am using Xalan.
>
> Greetings,
>
> Christian Caesar
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list