Using function from different namespace
Posted: Mon Mar 21, 2022 12:15 pm
Hi,
I have a problem with this regex function for getting the ticket ID from the subject of an email
Input:
Subject: Re: [Ticket0123456789] Testmail
Expected Result: aaVendorIncidentNumber -> [Ticket0123456789]
Instead of the Matching Substring I get the hole emailbody. I suggest it has something to do with the different namespaces.
How can I edit it correctly?
Info: I don't know why but the x-path functions are not available in namespace xsl
I have a problem with this regex function for getting the ticket ID from the subject of an email
Code: Select all
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
.............................
<xsl:variable name="aaVendorIncidentNumber">
<fn:analyze-string select="$emailSubject" regex="\[Ticket\d{{10}}\]">
<fn:matching-substring>
<xsl:value-of select="."/>
</fn:matching-substring>
</fn:analyze-string>
</xsl:variable>
....................
Subject: Re: [Ticket0123456789] Testmail
Expected Result: aaVendorIncidentNumber -> [Ticket0123456789]
Instead of the Matching Substring I get the hole emailbody. I suggest it has something to do with the different namespaces.
How can I edit it correctly?
Info: I don't know why but the x-path functions are not available in namespace xsl