[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!
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|