How to parse a string in XSLT divider?

Good day!
There is an XML document with the unloading of goods. In each card there is a tag that specifies the size in Width/Height/Length as using XSLT to split it on the delimiter /, and record the values in the tags.

From:
<cart>
...
...
...
<dimensions>15.2/44/13.5</dimensions>
...
</cart>


To do so:
<cart>
...
...
...
<width>15.2</width>
<height>44</height>
<length>13.5</length>
...
</cart>


Thanks in advance.
March 20th 20 at 11:29
2 answers
March 20th 20 at 11:31
Solution
XML
<cart>
<dimensions>15.2/44/13.5</dimensions>
</cart>


XSLt
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/cart">
the <div>
 <xsl:text>Width: </xsl:text>
 <xsl:value-of select="substring-before(dimensions, '/')"/>
</div>
the <div>
<xsl:text>Height:</xsl:text>
 <xsl:value-of select="substring-before(substring-after(dimensions, '/'), '/')"/>
</div>
the <div>
<xsl:text>Width:</xsl:text>
 <xsl:value-of select="substring-after(substring-after(dimensions, '/'), '/')"/>
</div>
</xsl:template>
</xsl:stylesheet>


Result
the <div>Width: 15.2</div>
the <div>Height:44</div>
the <div>Depth:13.5</div>


It?
Thank you, bro! - guadalupe commented on March 20th 20 at 11:34
Yes nesest)) - Kayden_Swi commented on March 20th 20 at 11:37
March 20th 20 at 11:33
More kosher is to use the function tokenize

Find more questions by tags XSL & XSLT