Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel 3 posts 73 karma points
    Apr 19, 2018 @ 07:35
    Daniel
    0

    How can i solve this problem in XSLT

    Hi all,

    I have a ticketing system which receives emails formatted in xml sent by users. The system uses an xslt script to convert the xml formatted email into the supported xml format that the system uses to create a ticket.

    Below is an example of the email format which is sent to the system:

    The content found between the tag Description is copied into the description of the ticket is below:

    First Name: Paul Last Name: Bonthuys Email Address: [email protected] Contact Number: 0123456789 How can we help you: Testing

    The issue I am having is that all the text after the email address is cut and not displayed in the ticket description field. So the description field only shows as below:

    First Name: Paul Last Name: Bonthuys Email Address: [email protected]

    Of course I have the option of moving the email address to the end of the Description tag, but I will like to keep the sequence of how the information is displayed i.e. First Name, Last Name, Email Address, Contact Number. I am suspecting that the email address hyperlink is causing the text after it to be cut and not being displayed.

    Below is a sample of my xslt script which copies the content of my email into the ticket description field:

    Anyone has an idea of how I could strip the hyperlink in the email address so that some texts are not cut? XSLT CODE

                                <xsl:variable name="Subject" select = "BusinessObjectList/BusinessObject/EmailMessage/Subject"/>
                                                <xsl:choose>
                                                                <xsl:when test="contains($Subject,'Incident#')"> 
                                                                                <xsl:call-template name="INCIDENT-UPDATE"/> 
                                                                </xsl:when>
    
                                                                <xsl:when test="contains(translate($Subject,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 'printer')"> 
                                                                                <xsl:call-template name="INCIDENT-KEYWORD-PRINTER"/> 
                                                                </xsl:when>
    
                                                                <xsl:when test="contains(translate($Subject,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 'outlook')"> 
                                                                                <xsl:call-template name="INCIDENT-KEYWORD-OUTLOOK"/> 
                                                                </xsl:when>
    
                                                                <xsl:when test="contains($Subject,'Service Request#')"> 
                                                                                <xsl:call-template name="SERVICE-REQUEST-UPDATE"/> 
                                                                </xsl:when>
                                                                <xsl:when test="contains($Subject,'Task#')"> 
                                                                                <xsl:call-template name="TASK-UPDATE"/> 
                                                                </xsl:when>
                                                                <xsl:otherwise>
                                                                                <xsl:call-template name="INCIDENT-NEW" />
    
                                                                </xsl:otherwise>
                                                </xsl:choose>
                                </BusinessObjectList>
                </xsl:template>
    
    
    
    
    
    
    
    
    
                <xsl:template name="INCIDENT-NEW">
                                <!-- 
                                                Erzeugt aus der e-Mail den XML Code zum Aktualisieren Anlage eines neuen Incidents
                                                - Die Attachments werden dem Incident hinzugefĆ¼gt
    
                                                Beispielaufruf: 
                                                <xsl:call-template name="INCIDENT-NEW" />
                                -->
    <!-- find the profile link recid of the email sender -->
                                <xsl:variable name="profilelink_recid">
    
                                <!-- for each RelatedBusinessObject -->
                               <xsl:for-each select="BusinessObjectList/BusinessObject/RelatedBusinessObjectList/RelatedBusinessObject/BusinessObject">
                                                <xsl:choose>
                                                                <xsl:when test="@Name = 'Employee'">
                                                                                <xsl:for-each select="./FieldList/Field">
                                                                                                <xsl:choose>
                                                                                                                <xsl:when test="@Name = 'RecId'">
                                                                                                                               <!-- <xsl:value-of select="."/>-->
                                                                                                                                <xsl:value-of select="'620F9E6687914E61A386572763768870'"/> 
                                                                                                                </xsl:when>
                                                                                                </xsl:choose>
                                                                                </xsl:for-each>
                                                                </xsl:when>
                                                </xsl:choose>
                                </xsl:for-each>
                                </xsl:variable>
    
    
    
    
    <!-- find the profile link category of the email sender -->
                                <xsl:variable name="profilelink_cat">
    
                                <!-- for each RelatedBusinessObject -->
                                <xsl:for-each select="BusinessObjectList/BusinessObject/RelatedBusinessObjectList/RelatedBusinessObject/BusinessObject">
                                                <xsl:choose>
                                                                <xsl:when test="@Name = 'Employee'">
                                                                                <xsl:value-of select="'Employee'"/>
                                                                </xsl:when>
                                                </xsl:choose>
                                </xsl:for-each>
                                </xsl:variable>
    
    <!-- for each BusinessObject -->
                                <xsl:for-each select="BusinessObjectList/BusinessObject">
                                <!-- Set the BO name -->
                                <xsl:element name="BusinessObject">
        <!-- Set BO Name as 'Incident' -->
                                                <xsl:attribute name="Name">
                                                                <xsl:value-of select="'Incident'"/>
                                                </xsl:attribute>
    
        <!-- Set Transaction as 'Insert' -->
        <xsl:element name="Transaction">UpdateAdd</xsl:element>
    
        <!--Unique Key List-->
        <xsl:element name="UniqueKeyList">
                                                <xsl:element name="UniqueKey">
                                                                <xsl:element name="Field">
                                                                                <xsl:attribute name="Name">
                                                                                                <xsl:value-of select="'IncidentNumber'"/>
                                                                                </xsl:attribute>
                                                                </xsl:element>
                                                </xsl:element>
        </xsl:element>
    
        <!-- Field List -->
        <FieldList>
          <!-- Fields -->
                                    <xsl:for-each select="EmailMessage/node()">
                                    <xsl:choose>
                                                                <!-- Incident.Subject = Email.Subject-->
                                                                <xsl:when test="name() = 'Subject'">
                                                                                <xsl:element name="Field">
                                                                                <xsl:attribute name="Name">
                                                                                                <xsl:value-of select="'Subject'"/>
                                                                                </xsl:attribute>
                                                                                <xsl:attribute name="Type">System.String</xsl:attribute>
                                                                                                <xsl:value-of select="."/>
                                                                                </xsl:element>
    
                                                                                 <xsl:element name="Field">
                                                                                <xsl:attribute name="Name">
                                                                                                <xsl:value-of select="'Category'"/>
                                                                                </xsl:attribute>
                                                                                <xsl:attribute name="Type">System.String</xsl:attribute>
                                                                                                <xsl:value-of select="."/>
                                                                                </xsl:element>
    
    
                                                                </xsl:when>
    
                                                                <xsl:when test="name() = 'Body'">
    
    
    
                                                                <xsl:variable name="emailbody" method="html" indent="yes" >
    

                                </xsl:element>
    
    </xsl:for-each>
    
                </xsl:template>
    

    TIA.

Please Sign in or register to post replies

Write your reply to:

Draft