Hi All,

The below is the value of the variable when used with apply templates

<results multiple-outputs="true" transactional="true"
xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/"
xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>
<url input="multi-request-A">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
<url input="multi-request-A">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
<url input="multi-request-A">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
</results>

The below is the value of a variable without apply templates and using for each

<results multiple-outputs="true" transactional="true">
<url input="multi-request-A">http://127.0.0.1:2026/ICS/CustomerProvider/v1</url>
<url input="multi-request-A">http://127.0.0.1:2027/ICS/CustomerProvider/v1</url>
<url input="multi-request-A">http://127.0.0.1:2028/ICS/CustomerProvider/v1</url>
</results>

How can i remove the namespaces coming when using apply templates


The xsl with apply templates

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/"
    xmlns:dp="http://www.datapower.com/extensions"
    extension-element-prefixes="dp">

    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">

        <xsl:apply-templates select="soapenv:Envelope/soapenv:Body/v1:CustomerServicegetCustomerInfoRequest1"/>

    </xsl:template>
    <xsl:template match="v1:CustomerServicegetCustomerInfoRequest1">
        <xsl:apply-templates select="v12:getCustomerInfoParameters"/>
    </xsl:template>



    <xsl:template match="v12:getCustomerInfoParameters">
        <xsl:apply-templates select="v12:customerInfoSearchKey/v12:cardNO"/>
    </xsl:template>


    <xsl:template match="v12:cardNO">


        <xsl:if test="position() = 1" >
            <xsl:variable name="request-A">
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-A'" value="$request-A"/>
        </xsl:if>
        <xsl:if test="position() = 2" >
            <xsl:variable name="request-B">
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-B'" value="$request-B"/>
        </xsl:if>
        <xsl:if test="position() = 3" >
            <xsl:variable name="request-C">
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-C'" value="$request-C"/>
        </xsl:if>

        <xsl:if test="position() = 4" >
            <xsl:variable name="request-D">
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-D'" value="$request-D"/>
        </xsl:if>

        <xsl:if test="position() = 5" >
            <xsl:variable name="request-E">
                <xsl:copy-of select="*[local-name() = 'customerInfoSearchKey']"/>
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-E'" value="$request-E"/>
        </xsl:if>

        <xsl:if test="position() = 6" >
            <xsl:variable name="request-F">
                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
                    <soapenv:Header>
                        <v1:RequestHeader>
                            <v11:correlationID>Corr12345678912345678912</v11:correlationID>
                            <v11:userId>Rejeesh</v11:userId>
                            <v11:sORRegionToken>
                                <v11:automationID/>
                                <v11:sORRegionID/>
                            </v11:sORRegionToken>
                        </v1:RequestHeader>
                    </soapenv:Header>
                    <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <v1:CustomerServicegetCustomerInfoRequest1>
                            <v12:getCustomerInfoParameters>
                                <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
                                <v12:customerInfoSearchKey>
                                    <v12:cardNO>
                                        <xsl:value-of select="*/*[local-name()='cardNO']"/>
                                    </v12:cardNO>
                                </v12:customerInfoSearchKey>
                                <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
                            </v12:getCustomerInfoParameters>
                        </v1:CustomerServicegetCustomerInfoRequest1>
                    </soapenv:Body>
                </soapenv:Envelope>
            </xsl:variable>
            <dp:set-variable name="'var://context/multi-request-F'" value="$request-F"/>
        </xsl:if>


        <xsl:variable name="request-targets">
            <results multiple-outputs="true" transactional="true">
                <xsl:if test="dp:variable('var://context/multi-request-A')">
                    <url input="multi-request-A">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-A">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-A">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
                <xsl:if test="dp:variable('var://context/multi-request-B')">
                    <url input="multi-request-B">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-B">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-B">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
                <xsl:if test="dp:variable('var://context/multi-request-C')">
                    <url input="multi-request-C">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-C">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-C">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
                <xsl:if test="dp:variable('var://context/multi-request-D')">
                    <url input="multi-request-D">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-D">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-D">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
                <xsl:if test="dp:variable('var://context/multi-request-E')">
                    <url input="multi-request-E">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-E">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-E">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
                <xsl:if test="dp:variable('var://context/multi-request-F')">
                    <url input="multi-request-F">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-F">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url>
                    <url input="multi-request-F">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url>
                </xsl:if>
            </results>
        </xsl:variable>

        <dp:set-variable name="'var://context/multi-request/targets'" value="$request-targets"/>


    </xsl:template>

</xsl:stylesheet>

xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:v11="http://www.americanexpress.com/schema/ICS/GlobalData/v1/" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/">
   <soapenv:Header>
      <v1:RequestHeader>
         <v11:correlationID>Corr12345678912345678912</v11:correlationID>
         <v11:userId>Rejeesh</v11:userId>
         <v11:sORRegionToken>
            <v11:automationID/>
            <v11:sORRegionID/>
         </v11:sORRegionToken>
      </v1:RequestHeader>
   </soapenv:Header>
   <soapenv:Body wsu:Id="id-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <v1:CustomerServicegetCustomerInfoRequest1>
         <v12:getCustomerInfoParameters>
            <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
            <v12:customerInfoSearchKey>
               <v12:cardNO>373560012861003</v12:cardNO>
            </v12:customerInfoSearchKey>
            <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
         </v12:getCustomerInfoParameters>
         <v12:getCustomerInfoParameters>
            <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
            <v12:customerInfoSearchKey>
               <v12:cardNO>373560012861004</v12:cardNO>
            </v12:customerInfoSearchKey>
            <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
         </v12:getCustomerInfoParameters>
       <v12:getCustomerInfoParameters>
            <v12:customerInfoTypeSelectionCD>CustomerInfo</v12:customerInfoTypeSelectionCD>
            <v12:customerInfoSearchKey>
               <v12:cardNO>373560012861005</v12:cardNO>
            </v12:customerInfoSearchKey>
            <v12:cardSelectionCD>AllCards</v12:cardSelectionCD>
         </v12:getCustomerInfoParameters>
      </v1:CustomerServicegetCustomerInfoRequest1>
   </soapenv:Body>
</soapenv:Envelope>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.