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

Re: Strings Position

Subject: Re: Strings Position
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 25 Nov 2003 23:14:00 +0100
xsl recursive position
Bruno LLopes wrote:
I have a string for exemple '00643cam 022002291 04500'
and I need look at every position of the string a see if each element
has the correct value...
How can  I shift the string position by position?

I'm not quite sure what your question is. If you want to split your string at certain positions, use substring(), for example <xsl:variable name="part1" select="substring($str,1,8)"/> If you want to split the string at certain characters, use substring-before() and substring-after(), like in <xsl:variable name="part1" select="substring-before($str,' ')"/>

If the string contains multiple parts, you can program unrolled code,
like
 <xsl:variable name="part1" select="substring-before($str,' ')"/>
 <xsl:variable name="tail1" select="substring-after($str,' ')"/>
 <xsl:variable name="part2" select="substring-before($tail1,' ')"/>
 <xsl:variable name="tail2" select="substring-after($tail1,' ')"/>
or use a recursive template as described in the XSL FAQ:
 http://www.dpawson.co.uk/xsl/sect2/N7240.html#d8065e280

J.Pietschmann


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.