0

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>

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
PuffTMD
  • 63
  • 9
  • The "matches" and "upper-case" functions are XSLT 2.0 functions. Does BizTalk mapper support that? – Tim C May 19 '14 at 16:57
  • @TimC you are correct, these are unsupported by the version of Biztalk were currently implementing. An alternative solution had to be sort :). – PuffTMD May 20 '14 at 06:17

1 Answers1

1

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;}
PuffTMD
  • 63
  • 9