Let me show you how to write sample xsl code for Email address validations using regex(Regular expression) and DVM(Domain value map) in Oracle BPM
1. After template match="/" create a variable called REGEX
<xsl:variable name="REGEX" select='dvm:lookupValue1M("oramds:/apps/common_artifacts/dvm/validation.dvm","Error","EMAIL_REGEX","condition")'/>
2. Use the following template to do the validations.
<xsl:if test="not(string-length(normalize-space(string(/inp1:request/inp1:emailAddress))) = 0) and not(string-length(normalize-space(string(/inp1:request/inp1:emailAddress))) > 5)">
<xsl:if test="not(xpath20:matches(/inp1:request/inp1:emailAddress,$REGEX))">
<ns1:errCod>
<xsl:value-of select='dvm:lookupValue1M("oramds:/apps/common_artifacts/Mappings.dvm","ProcessErrorCode","3","code")'/>
</ns1:errCod>
</xsl:if>
</xsl:if>
1. After template match="/" create a variable called REGEX
<xsl:variable name="REGEX" select='dvm:lookupValue1M("oramds:/apps/common_artifacts/dvm/validation.dvm","Error","EMAIL_REGEX","condition")'/>
2. Use the following template to do the validations.
<xsl:if test="not(string-length(normalize-space(string(/inp1:request/inp1:emailAddress))) = 0) and not(string-length(normalize-space(string(/inp1:request/inp1:emailAddress))) > 5)">
<xsl:if test="not(xpath20:matches(/inp1:request/inp1:emailAddress,$REGEX))">
<ns1:errCod>
<xsl:value-of select='dvm:lookupValue1M("oramds:/apps/common_artifacts/Mappings.dvm","ProcessErrorCode","3","code")'/>
</ns1:errCod>
</xsl:if>
</xsl:if>
No comments:
Post a Comment