Validate phone XSLT 1.0

Viewed 46

i want need help about validate phone number when the first number have some static number for every phone. like phone number for home,and company or and from handphone , i want trying detecting and validate the number was valid or not. how to take number after 62 and 021. thanks for help

Sample number :

6281234567890 and 02141234567 
1 Answers

i need to take the number after 62 and 021

You could do something like:

<xsl:choose>
    <xsl:when test="starts-with(phone, '021')">
        <xsl:value-of select="substring-after(phone, '021')" />
    </xsl:when>
    <xsl:when test="starts-with(phone, '62')">
        <xsl:value-of select="substring-after(phone, '62')" />
    </xsl:when>
    <xsl:otherwise>???</xsl:otherwise>
</xsl:choose>

Don't see what this has to do with validation.

Related