PuffTMD
PuffTMD

Reputation: 63

Biztalk Mapper Inline XSLT Call Template Email Validation

I'm trying to validate an email address via a map to confirm to the validation rule \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+). I'm new to this and haven't found much help via search, so will post the in-line xslt call I have to see if someone can correct my mistake.

<xsl:template name="EmailAdress" xmlns:msxsl="urn:schemas-microsoft-com:xslt" >
 <xsl:param name="inEmail"/>
 <xsl:element name="p:Email" >
     <xsl:value-of select="Maches(upper-case(inEmail),'\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)'/>
 </xsl:element>

Upvotes: 0

Views: 547

Answers (1)

PuffTMD
PuffTMD

Reputation: 63

This was handled by implementing two script functoids (one inline xslt Call Template, the other Inline C#) with the following code execution:

One

<xsl:template name="eaddress">
  <xsl:param name="memail"/>
  <xsl:if test="userCSharp:valEmailAdd(.)">
    <email><xsl:value-of select="."/><email>
  </xsl:if>
</xsl:template>

Two

public bool valEmailAdd(string eadd) {return regex.match(eadd, @"<validation>").Success;}

Upvotes: 1

Related Questions