[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Counting only some children of a node - nevermind!

Subject: Re: Counting only some children of a node - nevermind!
From: Christian Cäsar <caesar@xxxxxxxxxxxx>
Date: Thu, 23 Aug 2001 13:03:24 +0200
christian caesar
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.