|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Count Words
You could use the exslt:tokenize extension function with XSLT 1.0, or the built-in tokenize() function with XSLT 2.0. Alternatively: <xsl:variable name="in" select="normalize-space(hey_diddle)"/> <xsl:value-of select="string-length(translate($in, translate($in, ' ', ''))) + 1"/> Michael Kay > -----Original Message----- > From: Karl J. Stubsjoen [mailto:karl@xxxxxxxxxxxxxxxxxxxx] > Sent: 08 August 2004 21:19 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Count Words > > Hello, > > Given the following: > > =========== xml source ========== > <poem> > <hey_diddle> > Hey diddle diddle, the cat and the fiddle, > The cow jumped over the moon, > The little dog laughed to see such sport, > And the dish ran away with the spoon. > </hey_diddle> > </poem> > =========== /xml source ========== > > How do I count how many words are contained within the node > <hey_diddle/>? > > Karl
|
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
|

Cart








