I would like to know if there is a way to split correctly UK postcodes using XSLT 1.0.
For example:
PE92BD --> PE9 2BD
NE611PE --> NE61 1PE
CV364AB --> CV36 4AB
SN13EG --> SN1 3EG
IP242AN --> IP24 2AN
I would like to know if there is a way to split correctly UK postcodes using XSLT 1.0.
For example:
PE92BD --> PE9 2BD
NE611PE --> NE61 1PE
CV364AB --> CV36 4AB
SN13EG --> SN1 3EG
IP242AN --> IP24 2AN
I would like to know if there is a way to split correctly UK postcodes using XSLT 1.0.
Assuming that by "split correctly" you mean place a space before the last three characters, you can do:
<xsl:variable name="length" select="string-length($postcode)" />
<xsl:value-of select="substring($postcode, 1, $length - 3)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="substring($postcode, $length - 2)"/>