none
Xslt Help - How to Map the Common information in repeating node RRS feed

  • Question

  • Hi All,

    I need a xslt help for my biztalk map. 

    Input:

    <queryResponse xmlns="urn:enterprise.soap.sforce.com">
      <result>
        <done>true</done>
        <queryLocator xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
    <records xsi:type="sf:CPR__SCResource__c" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <sf:Id xmlns:sf="urn:sobject.enterprise.soap.sforce.com">a1FK0000004p0tEMAQ</sf:Id>
          <sf:CPR__Alias__c xmlns:sf="urn:sobject.enterprise.soap.sforce.com">panchalb</sf:CPR__Alias__c>
          <sf:CPR__Assignments__r xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
            <done>true</done>
            <queryLocator xsi:nil="true" />
            <records xsi:type="sf:CPR__SCAssignment__c">
              <sf:Id xsi:nil="true" />
              <sf:CPR__Order__r xsi:type="sf:CPR__SCOrder__c">
                <sf:Id xsi:nil="true" />
                <sf:CPR__Status__c>5503</sf:CPR__Status__c>
                <sf:Case__r xsi:type="sf:Case">
                  <sf:Id>500K000000CkqocIAB</sf:Id>
                  <sf:Account xsi:type="sf:Account">
                    <sf:Id xsi:nil="true" />
                    <sf:BillingCity>Vellore</sf:BillingCity>
                    <sf:BillingState>Tamil Nadu</sf:BillingState>
                    <sf:Name>Appolo</sf:Name>
                  </sf:Account>
                  <sf:Account_Address__c>No: 123456 , Vellore , Tamil Nadu , 632006 , India</sf:Account_Address__c>
                  <sf:Account_Number__c>12345678</sf:Account_Number__c>
                  <sf:Account_Zip_Code__c>0909993</sf:Account_Zip_Code__c>
                  <sf:CaseNumber>CAS-0002719159</sf:CaseNumber>
                  <sf:Case_Owner__c>Mukund</sf:Case_Owner__c>
                  <sf:City__c>Vellore</sf:City__c>
                  <sf:Contact xsi:type="sf:Contact">
                    <sf:Id xsi:nil="true" />
                    <sf:Name>Hari</sf:Name>
                  </sf:Contact>
                  <sf:Material_Description__c>cobas e411 disk</sf:Material_Description__c>
                  <sf:Material_Number__r xsi:type="sf:CPR__SCArticle__c">
                    <sf:Id xsi:nil="true" />
                    <sf:Name>999999999</sf:Name>
                  </sf:Material_Number__r>
                  <sf:OwnerId>005K0000003inBXIAY00000</sf:OwnerId>
                  <sf:Primary_Phone_Number__c>+91999999999</sf:Primary_Phone_Number__c>
                  <sf:Requested_Date__c>2015-10-21T10:18:00.000Z</sf:Requested_Date__c>
                  <sf:Serial_Number__c>1119-159</sf:Serial_Number__c>
                  <sf:Status>Closed</sf:Status>
                </sf:Case__r>
                <sf:CreatedDate>2015-10-21T10:21:17.000Z</sf:CreatedDate>
                <sf:Name>ORD-0004689031</sf:Name>
              </sf:CPR__Order__r>
            </records>
            <records xsi:type="sf:CPR__SCAssignment__c">
              <sf:Id xsi:nil="true" />
              <sf:CPR__Order__r xsi:type="sf:CPR__SCOrder__c">
                <sf:Id xsi:nil="true" />
                <sf:CPR__Status__c>5503</sf:CPR__Status__c>
                <sf:Case__r xsi:type="sf:Case">
                  <sf:Id>500K000000CkqhvIAB</sf:Id>
                  <sf:Account xsi:type="sf:Account">
                    <sf:Id xsi:nil="true" />
                    <sf:BillingCity>Vellore</sf:BillingCity>
                    <sf:BillingState>Tamil Nadu</sf:BillingState>
                    <sf:Name>Specialities Centre</sf:Name>
                  </sf:Account>
                  <sf:Account_Address__c>No: 121212 , Tirupati , AP , 632006 , India</sf:Account_Address__c>
                  <sf:Account_Number__c>0052049618</sf:Account_Number__c>
                  <sf:Account_Zip_Code__c>632006</sf:Account_Zip_Code__c>
                  <sf:CaseNumber>CAS-0002719158</sf:CaseNumber>
                  <sf:Case_Owner__c>Krishna</sf:Case_Owner__c>
                  <sf:City__c>Chittoor</sf:City__c>
                  <sf:Contact xsi:type="sf:Contact">
                    <sf:Id xsi:nil="true" />
                    <sf:Name>Prasad</sf:Name>
                  </sf:Contact>
                  <sf:Material_Description__c>e411 disk</sf:Material_Description__c>
                  <sf:Material_Number__r xsi:type="sf:CPR__SCArticle__c">
                    <sf:Id xsi:nil="true" />
                    <sf:Name>99887766</sf:Name>
                  </sf:Material_Number__r>
                  <sf:OwnerId>005K0000003inBXIAY11111</sf:OwnerId>
                  <sf:Primary_Phone_Number__c>+9188888888888</sf:Primary_Phone_Number__c>
                  <sf:Requested_Date__c>2016-01-21T09:31:00.000Z</sf:Requested_Date__c>
                  <sf:Serial_Number__c>1119-20</sf:Serial_Number__c>
                  <sf:Status>Dispatched</sf:Status>
                </sf:Case__r>
                <sf:CreatedDate>2016-01-21T09:37:02.000Z</sf:CreatedDate>
                <sf:Name>ORD-0004689029</sf:Name>
              </sf:CPR__Order__r>
            </records>
            <size>2</size>
          </sf:CPR__Assignments__r>
          <sf:CPR__EMail__c xmlns:sf="urn:sobject.enterprise.soap.sforce.com">jayaprakash.manickam@roche.com</sf:CPR__EMail__c>
          <sf:CPR__Employee__r xsi:type="sf:User" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
            <sf:Id xsi:nil="true" />
            <sf:First_Level_Supervisor__r xsi:type="sf:User">
              <sf:Id xsi:nil="true" />
              <sf:Alias>manickaj</sf:Alias>
              <sf:Email>1stSupervisor@gmail.com</sf:Email>
              <sf:Name> Manickam</sf:Name>
              <sf:Phone>7777777777</sf:Phone>
            </sf:First_Level_Supervisor__r>       
            <sf:Second_Level_Supervisor__r xsi:type="sf:User">
              <sf:Id xsi:nil="true" />
              <sf:Alias>manickaj</sf:Alias>
              <sf:Email>2ndSuperviror@gmail.com</sf:Email>
              <sf:Name>Jayaprakash</sf:Name>
              <sf:Phone>919841030601</sf:Phone>
            </sf:Second_Level_Supervisor__r>
          </sf:CPR__Employee__r>
          <sf:CPR__Phone__c xmlns:sf="urn:sobject.enterprise.soap.sforce.com">+9133333333333</sf:CPR__Phone__c>
          <sf:CPR__Resource_Assignments__r xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
            <done>true</done>
            <queryLocator xsi:nil="true" />
            <records xsi:type="sf:CPR__SCResourceAssignment__c">
              <sf:Id xsi:nil="true" />
              <sf:CPR__CountryState__c>MO</sf:CPR__CountryState__c>
              <sf:CPR__Department__r xsi:type="sf:CPR__SCBusinessUnit__c">
                <sf:Id xsi:nil="true" />
                <sf:Name>IN West</sf:Name>
              </sf:CPR__Department__r>
              <sf:CPR__District__c>Vadodara</sf:CPR__District__c>
            </records>
            <size>1</size>
          </sf:CPR__Resource_Assignments__r>
          <sf:Name xmlns:sf="urn:sobject.enterprise.soap.sforce.com">Bhaumik Panchal</sf:Name>
        </records>
    
    	<size>157</size>
      </result>
    </queryResponse>


    Expected Output: 

    <ns0:tblSMSCaseDetails xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/ViewOp/dbo/SMS_Case_Details" xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Views/dbo" xmlns:array="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <ns3:SMS_Case_Details_TYPE>
        <ns3:case_id>CAS-0002719159</ns3:case_id>
        <ns3:create_date>2015-10-21T10:18:00.000Z</ns3:create_date>
        <ns3:Cust_id>12345678</ns3:Cust_id>
        <ns3:Cust_name>Appolo</ns3:Cust_name>
        <ns3:Contact_Person>Hari</ns3:Contact_Person>
        <ns3:Contact_Phone>+91999999999</ns3:Contact_Phone>
        <ns3:Address>No: 123456 , Vellore , Tamil Nadu , 632006 , India</ns3:Address>
        <ns3:city>Vellore</ns3:city>
        <ns3:cust_district>Vellore</ns3:cust_district>
        <ns3:Pincode>0909993</ns3:Pincode>
        <ns3:Cust_State>Tamil Nadu</ns3:Cust_State>
        <ns3:FSE_user_id>005K0000003inBXIAY00000</ns3:FSE_user_id>
        <ns3:FSE_Name>Mukund</ns3:FSE_Name>
        <ns3:GMMI>999999999</ns3:GMMI>
        <ns3:serial_no>1119-159</ns3:serial_no>
        <ns3:Instru_Description>cobas e411 disk</ns3:Instru_Description>
        <ns3:Case_Status>Closed</ns3:Case_Status>
        <ns3:FSE_Email>jayaprakash.manickam@roche.com</ns3:FSE_Email>
        <ns3:FSE_Phone>+9133333333333</ns3:FSE_Phone>
        <ns3:FSE_State>MO</ns3:FSE_State>
        <ns3:FSE_Region>IN West</ns3:FSE_Region>
        <ns3:FSE_District>Vadodara</ns3:FSE_District>
        <ns3:Mgr_User_id>manickaj</ns3:Mgr_User_id>
        <ns3:MGR_Name> Manickam</ns3:MGR_Name>
        <ns3:MGR_Email>1stSupervisor@gmail.com</ns3:MGR_Email>
        <ns3:MGR_Phone>7777777777</ns3:MGR_Phone>
        <ns3:Sec_Mgr_User_id>manickaj</ns3:Sec_Mgr_User_id>
        <ns3:Sec_MGR_Name>Jayaprakash</ns3:Sec_MGR_Name>
        <ns3:Sec_MGR_Email>2ndSuperviror@gmail.com</ns3:Sec_MGR_Email>
        <ns3:Sec_MGR_Phone>919841030601</ns3:Sec_MGR_Phone>
        <ns3:Location />
        <ns3:Clarify_Work_Performed />
      </ns3:SMS_Case_Details_TYPE>
      <ns3:SMS_Case_Details_TYPE>
        <ns3:case_id>CAS-0002719158</ns3:case_id>
        <ns3:create_date>2016-01-21T09:31:00.000Z</ns3:create_date>
        <ns3:Cust_id>0052049618</ns3:Cust_id>
        <ns3:Cust_name>Specialities Centre</ns3:Cust_name>
        <ns3:Contact_Person>Prasad</ns3:Contact_Person>
        <ns3:Contact_Phone>+9188888888888</ns3:Contact_Phone>
        <ns3:Address>No: 121212 , Tirupati , AP , 632006 , India</ns3:Address>
        <ns3:city>Chittoor</ns3:city>
        <ns3:cust_district>Vellore</ns3:cust_district>
        <ns3:Pincode>632006</ns3:Pincode>
        <ns3:Cust_State>Tamil Nadu</ns3:Cust_State>
        <ns3:FSE_user_id>005K0000003inBXIAY11111</ns3:FSE_user_id>
        <ns3:FSE_Name>Krishna</ns3:FSE_Name>
        <ns3:GMMI>99887766</ns3:GMMI>
        <ns3:serial_no>1119-20</ns3:serial_no>
        <ns3:Instru_Description>e411 disk</ns3:Instru_Description>
        <ns3:Case_Status>Dispatched</ns3:Case_Status>
        <ns3:FSE_Email>jayaprakash.manickam@roche.com</ns3:FSE_Email>
        <ns3:FSE_Phone>+9133333333333</ns3:FSE_Phone>
        <ns3:FSE_State>MO</ns3:FSE_State>
        <ns3:FSE_Region>IN West</ns3:FSE_Region>
        <ns3:FSE_District>Vadodara</ns3:FSE_District>
        <ns3:Mgr_User_id>manickaj</ns3:Mgr_User_id>
        <ns3:MGR_Name> Manickam</ns3:MGR_Name>
        <ns3:MGR_Email>1stSupervisor@gmail.com</ns3:MGR_Email>
        <ns3:MGR_Phone>7777777777</ns3:MGR_Phone>
        <ns3:Sec_Mgr_User_id>manickaj</ns3:Sec_Mgr_User_id>
        <ns3:Sec_MGR_Name>Jayaprakash</ns3:Sec_MGR_Name>
        <ns3:Sec_MGR_Email>2ndSuperviror@gmail.com</ns3:Sec_MGR_Email>
        <ns3:Sec_MGR_Phone>919841030601</ns3:Sec_MGR_Phone>
        <ns3:Location />
        <ns3:Clarify_Work_Performed />
      </ns3:SMS_Case_Details_TYPE>
    
    </ns0:tblSMSCaseDetails>

    For each CPR__Assignments__r/records in the input, I need to form the   <ns3:SMS_Case_Details_TYPE> record in output. 

    However CPR__Employee__r,CPR__Resource_Assignments__r,CPR__Phone__c,CPR__EMail__c are same for both the records in output. 

    I am not able to map the common information in both the records in output. 

    My Xslt is as follows, please help. 

    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                    xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 s1" version="1.0"
                    xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/ViewOp/dbo/SMS_Case_Details"
                    xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Views/dbo" xmlns:array="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
                    xmlns:s0="urn:sobject.enterprise.soap.sforce.com" xmlns:s1="urn:enterprise.soap.sforce.com">
      <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
      <xsl:template match="/">
        <xsl:apply-templates select="/s1:queryResponse" />
      </xsl:template>
      <xsl:template match="/s1:queryResponse">
        <ns0:tblSMSCaseDetails>
          <xsl:for-each select="s1:result/s1:records">
            <xsl:if test="count(s0:CPR__Assignments__r) > 0">         
              <xsl:for-each select="s0:CPR__Assignments__r/s1:records">         
                <xsl:call-template name="SMSCaseData">
                </xsl:call-template>
                </xsl:for-each>
                  <ns3:FSE_Email>
                    <xsl:value-of select="s0:CPR__EMail__c/text()"/>
                  </ns3:FSE_Email>
                  <ns3:FSE_Phone>
                    <xsl:value-of select="s0:CPR__Phone__c/text()"/>
                  </ns3:FSE_Phone>
                  <ns3:FSE_State>
                    <xsl:value-of select="s0:CPR__Resource_Assignments__r/s1:records/s0:CPR__CountryState__c/text()"/>
                  </ns3:FSE_State>
                  <ns3:FSE_Region>
                    <xsl:value-of select="s0:CPR__Resource_Assignments__r/s1:records/s0:CPR__Department__r/s0:Name/text()"/>
                  </ns3:FSE_Region>
                  <ns3:FSE_District>
                    <xsl:value-of select="s0:CPR__Resource_Assignments__r/s1:records/s0:CPR__District__c/text()"/>
                  </ns3:FSE_District>
                  <ns3:Mgr_User_id>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:First_Level_Supervisor__r/s0:Alias/text()"/>
                  </ns3:Mgr_User_id>
                  <ns3:MGR_Name>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:First_Level_Supervisor__r/s0:Name/text()"/>
                  </ns3:MGR_Name>
                  <ns3:MGR_Email>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:First_Level_Supervisor__r/s0:Email/text()"/>
                  </ns3:MGR_Email>
                  <ns3:MGR_Phone>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:First_Level_Supervisor__r/s0:Phone/text()"/>
                  </ns3:MGR_Phone>
                  <ns3:Sec_Mgr_User_id>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:Second_Level_Supervisor__r/s0:Alias/text()"/>
                  </ns3:Sec_Mgr_User_id>
                  <ns3:Sec_MGR_Name>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:Second_Level_Supervisor__r/s0:Name/text()"/>
                  </ns3:Sec_MGR_Name>
                  <ns3:Sec_MGR_Email>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:Second_Level_Supervisor__r/s0:Email/text()"/>
                  </ns3:Sec_MGR_Email>
                  <ns3:Sec_MGR_Phone>
                    <xsl:value-of select="s0:CPR__Employee__r/s0:Second_Level_Supervisor__r/s0:Phone/text()"/>
                  </ns3:Sec_MGR_Phone>
                  <ns3:Location></ns3:Location>              
                  <ns3:Clarify_Work_Performed></ns3:Clarify_Work_Performed>
            </xsl:if>
          </xsl:for-each>
        </ns0:tblSMSCaseDetails>
      </xsl:template>
      <xsl:template name="SMSCaseData">
        <ns3:SMS_Case_Details_TYPE>
          <ns3:case_id>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:CaseNumber/text()"/>
          </ns3:case_id>
          <ns3:create_date>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Requested_Date__c/text()"/>
          </ns3:create_date>
          <ns3:Cust_id>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Number__c/text()"/>
          </ns3:Cust_id>
          <ns3:Cust_name>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:Name/text()"/>
          </ns3:Cust_name>
          <ns3:Contact_Person>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Contact/s0:Name/text()"/>
          </ns3:Contact_Person>
          <ns3:Contact_Phone>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Primary_Phone_Number__c/text()"/>
          </ns3:Contact_Phone>
          <ns3:Address>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Address__c/text()"/>
          </ns3:Address>
          <ns3:city>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:City__c/text()"/>
          </ns3:city>
          <ns3:cust_district>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:BillingCity/text()"/>
          </ns3:cust_district>
          <ns3:Pincode>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Zip_Code__c/text()"/>
          </ns3:Pincode>
          <ns3:Cust_State>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:BillingState/text()"/>
          </ns3:Cust_State>
          <ns3:FSE_user_id>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:OwnerId/text()"/>
          </ns3:FSE_user_id>
          <ns3:FSE_Name>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Case_Owner__c/text()"/>
          </ns3:FSE_Name>
          <ns3:GMMI>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Material_Number__r/s0:Name/text()"/>
          </ns3:GMMI>
          <ns3:serial_no>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Serial_Number__c/text()"/>
          </ns3:serial_no>
          <ns3:Instru_Description>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Material_Description__c/text()"/>
          </ns3:Instru_Description>
          <ns3:Case_Status>
            <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Status/text()"/>
          </ns3:Case_Status>
          
        </ns3:SMS_Case_Details_TYPE>
      </xsl:template>
    </xsl:stylesheet>

    Monday, January 25, 2016 12:58 PM

Answers

All replies

  • First, why are you using Xslt?  Meaning, what about the Mapper (Links and Functoids) is not working for you?

    In this case, if you're using the Mapper, you can connect the common elements from the source through an Index Functoid with the second parameter set to 1.  That means map the value from the first instance of the source, Employee, Resource, etc. in your case.

    Details here: https://msdn.microsoft.com/en-us/library/ee253838%28v=bts.10%29.aspx

    Monday, January 25, 2016 1:33 PM
    Moderator
  • BizTalk mapper is giving unexpected results (empty in most cases) as the source schema is very big and not easy to locate the each element described in sample, so I am using xslt.  And when I search for any element in BizTalk map visual studio is not responding (it's taking long time to find the element in source schema).  I had to close the solution and re-open it. 

    Please let me know if there is anyway to achieve this in XSLT. 

    Monday, January 25, 2016 1:49 PM
  • Link at least one set of fields using the Mapper, then do a Validate Map and view the generated xslt.

    Use the generated xslt as a sample.  Using the Index Functoid will generate the xslt you need.

    Monday, January 25, 2016 4:22 PM
    Moderator
  • Hi,

    Try this.

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                    xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Views/dbo"
                    xmlns:s0="urn:sobject.enterprise.soap.sforce.com"
                    xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/ViewOp/dbo/SMS_Case_Details"
                    xmlns:array="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
                    exclude-result-prefixes="msxsl"
    >
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="/">
    
        <ns0:tblSMSCaseDetails xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/ViewOp/dbo/SMS_Case_Details" xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/Views/dbo" xmlns:array="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    
          <xsl:for-each select="/*[local-name()='queryResponse' and namespace-uri()='urn:enterprise.soap.sforce.com']/*[local-name()='result' and namespace-uri()='urn:enterprise.soap.sforce.com']/*[local-name()='records' and namespace-uri()='urn:enterprise.soap.sforce.com']/*[local-name()='CPR__Assignments__r' and namespace-uri()='urn:sobject.enterprise.soap.sforce.com']/*[local-name()='records' and namespace-uri()='urn:enterprise.soap.sforce.com']">
            <ns3:SMS_Case_Details_TYPE>
              <ns3:case_id>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:CaseNumber/text()"/>
              </ns3:case_id>
              <ns3:create_date>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Requested_Date__c/text()"/>
              </ns3:create_date>
              <ns3:Cust_id>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Number__c/text()"/>
              </ns3:Cust_id>
              <ns3:Cust_name>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:Name/text()"/>
              </ns3:Cust_name>
              <ns3:Contact_Person>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Contact/s0:Name/text()"/>
              </ns3:Contact_Person>
              <ns3:Contact_Phone>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Primary_Phone_Number__c/text()"/>
              </ns3:Contact_Phone>
              <ns3:Address>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Address__c/text()"/>
              </ns3:Address>
              <ns3:city>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:City__c/text()"/>
              </ns3:city>
              <ns3:cust_district>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:BillingCity/text()"/>
              </ns3:cust_district>
              <ns3:Pincode>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account_Zip_Code__c/text()"/>
              </ns3:Pincode>
              <ns3:Cust_State>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Account/s0:BillingState/text()"/>
              </ns3:Cust_State>
              <ns3:FSE_user_id>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:OwnerId/text()"/>
              </ns3:FSE_user_id>
              <ns3:FSE_Name>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Case_Owner__c/text()"/>
              </ns3:FSE_Name>
              <ns3:GMMI>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Material_Number__r/s0:Name/text()"/>
              </ns3:GMMI>
              <ns3:serial_no>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Serial_Number__c/text()"/>
              </ns3:serial_no>
              <ns3:Instru_Description>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Material_Description__c/text()"/>
              </ns3:Instru_Description>
              <ns3:Case_Status>
                <xsl:value-of select="s0:CPR__Order__r/s0:Case__r/s0:Status/text()"/>
              </ns3:Case_Status>
              <ns3:FSE_Email>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__EMail__c']"/>
              </ns3:FSE_Email>
              <ns3:FSE_Phone>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Phone__c']"/>
              </ns3:FSE_Phone>
              <ns3:FSE_State>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Resource_Assignments__r']/*[local-name()='records']/*[local-name()='CPR__CountryState__c']"/>
              </ns3:FSE_State>
              <ns3:FSE_Region>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Resource_Assignments__r']/*[local-name()='records']/*[local-name()='CPR__Department__r']/*[local-name()='Name']"/>
              </ns3:FSE_Region>
              <ns3:FSE_District>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Resource_Assignments__r']/*[local-name()='records']/*[local-name()='CPR__District__c']"/>
              </ns3:FSE_District>
              <ns3:Mgr_User_id>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='First_Level_Supervisor__r']/*[local-name()='Alias']"/>
              </ns3:Mgr_User_id>
              <ns3:MGR_Name>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='First_Level_Supervisor__r']/*[local-name()='Name']"/>
              </ns3:MGR_Name>
              <ns3:MGR_Email>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='First_Level_Supervisor__r']/*[local-name()='Email']"/>
              </ns3:MGR_Email>
              <ns3:MGR_Phone>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='First_Level_Supervisor__r']/*[local-name()='Phone']"/>
              </ns3:MGR_Phone>
              <ns3:Sec_Mgr_User_id>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='Second_Level_Supervisor__r']/*[local-name()='Alias']"/>
              </ns3:Sec_Mgr_User_id>
              <ns3:Sec_MGR_Name>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='Second_Level_Supervisor__r']/*[local-name()='Name']"/>
              </ns3:Sec_MGR_Name>
              <ns3:Sec_MGR_Email>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='Second_Level_Supervisor__r']/*[local-name()='Email']"/>
              </ns3:Sec_MGR_Email>
              <ns3:Sec_MGR_Phone>
                <xsl:value-of select="/*[local-name()='queryResponse']/*[local-name()='result']/*[local-name()='records']/*[local-name()='CPR__Employee__r']/*[local-name()='Second_Level_Supervisor__r']/*[local-name()='Phone']"/>
              </ns3:Sec_MGR_Phone>
              <!--TODO-->
              <ns3:Location />
              <ns3:Clarify_Work_Performed />
              <!--TODO-->
            </ns3:SMS_Case_Details_TYPE>
          </xsl:for-each>
        </ns0:tblSMSCaseDetails>
      </xsl:template>
    </xsl:stylesheet>
    

    Best regards

    Rasmus Jaeger

    Wednesday, January 27, 2016 1:05 PM