xsl-list
[Top] [All Lists]

Re: [xsl] XSL substrings

2009-02-12 05:58:35
 <DIMENSION>T=40 101x16</DIMENSION>

What I want is to get "<Thickness>", which is the number after the
"T=", "<Length>" which the number before the "x" and <Width>" which is
the number after the "x".

Probably easiest to just do:

<xsl:variable name="thickness"
select="substring-after(substring-before(., ' '), 'T=')"/>
<xsl:variable name="length-and-width" select="substring-after(., ' ')"/>
<xsl:variable name="length" select="substring-before($length-and-width, 'x')"/>
<xsl:variable name="width" select="substring-after($length-and-width, 'x')"/>

...but you can always make them all one-liners.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>