[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: count the number of occurrences of an element whic
From: "Jayaranga Subasinghe" <jayarangas@xxxxxxxxxxxxx> > > I want to count the number of occurrences of an element<keyword>, > which 'xml:lang' attribute is 'en'. > the xml file is as follows: > <KEYWORD xml:lang="en">Keyword 1</KEYWORD> > <KEYWORD xml:lang="en">Keyword 2</KEYWORD> > <KEYWORD xml:lang="no">Sokeord 1</KEYWORD> > <KEYWORD xml:lang="no">Sokeord 2</KEYWORD> > <KEYWORD xml:lang="no">Sokeord 3</KEYWORD> > Hi Jayaranga, try the following:- <xsl:template match="/"> You have <xsl:value-of select="count(//KEYWORD[@xml:lang='en'])"/> English KEYWORDs. </xsl:template> Regards, Rob -- Rob Lugt ElCel Technology http://www.elcel.com/ 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
|