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

RE: values in sequence after tokenize

Subject: RE: values in sequence after tokenize
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 11 Jul 2006 15:10:14 +0100
after toke
The regex given to tokenize determines the separator between tokens, not the
content of the tokens.

I'm not quite sure what result you expect here (or in general). You can
probably tackle it using xsl:analyze-string, which is more powerful than
tokenize().

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: andrew welch [mailto:andrew.j.welch@xxxxxxxxx] 
> Sent: 11 July 2006 14:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  values in sequence after tokenize
> 
> Given a string of characters:
> 
> <xsl:variable name="string" select="'aa^a^aaa^aaaaaa^aa^aa^aaaaaa^'"/>
> 
> I want to break that string into substrings up to a given 
> length, so that the words including circumflexes ('^') are no 
> longer than the specified length.
> 
> I'm trying do this with a regex (in this example the length is 6):
> 
> <xsl:variable name="substring" select="tokenize($string, '.{1,6}\^')"
> as="xs:string*"/>
> 
> This regex must be wrong because $substring now holds a 
> sequence of 6 items (as expected), but each of those items 
> appears to be ' '.  For example this bit of debug:
> 
> x<xsl:value-of select="for $y in $substring return concat($y, 'z')"/>x
> 
> produces:
> 
> xz z z z z zx
> 
> What's the correct regex for this problem?
> 
> thanks
> andrew

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.