none
How can i transform Multiple xmls to one xml in Logic app RRS feed

  • Question

  • Hi Team,

    Currently i have wrote a xslt and designed a logic app workflow to convert one xml to another format xml, but my requirement is create logic app workflow for a multiple xmls (list of xmls) convert to one xml line (Numbers) wise, Could you please support to do that, i think i need to modify my current xslt map as well could you please support for that. for your reference here with attached current logic app workflow and sample xslt map.

    LA workflow

    single xml mapping sample xslt-

    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cw="http://www.cawse.com/Schemas/Universal/2011/11" exclude-result-prefixes="cw">
    <xsl:output indent="yes" method="xml"/>

    <xsl:template match="/cw:UniversalInterchange">
    <tblFreight_Excel_Upload>
    <intFreightExcelCode>1</intFreightExcelCode>
    <InvoiceNo>
    <xsl:value-of select="cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:DataContext/cw:DataSourceCollection/cw:DataSource/cw:Key"/>
    </InvoiceNo>
    <DOC>

    <xsl:value-of select="format-number(sum(cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:PostingJournalCollection/cw:PostingJournal[contains('_DO_DDOCU_IOUDDOCUM_', concat('_',cw:ChargeCode/cw:Code,'_'))]/cw:ChargeTotalAmount), '#.0000')"/>
    </DOC>
    <FREIGHT>

    <xsl:value-of select="format-number(sum(cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:PostingJournalCollection/cw:PostingJournal[contains('_CONGESC_FRT_GRI_PIER_', concat('_',cw:ChargeCode/cw:Code,'_'))]/cw:ChargeTotalAmount), '#.0000')"/>
    </FREIGHT>


    </tblFreight_Excel_Upload>
    </xsl:template>
    </xsl:stylesheet>

    Current out put-:

    <?xml version="1.0" encoding="utf-8"?>
    <tblFreight_Excel_Upload>
    <intFreightExcelCode>1</intFreightExcelCode>
    <InvoiceNo>AR INV EGL-CM1-00023151</InvoiceNo>
    <DOC>67.0000</DOC>
    <FREIGHT>1605.1200</FREIGHT>
    </tblFreight_Excel_Upload>

    Expected output-

    <?xml version="1.0" encoding="utf-8"?>
    <tblFreight_Excel_Upload>
    <intFreightExcelCode>1</intFreightExcelCode>
    <InvoiceNo>AR INV EFL-CM1-00023151</InvoiceNo>
    <DOC>.0000</DOC>
    <FREIGHT>1605.1200</FREIGHT>

    <intFreightExcelCode>2</intFreightExcelCode>
    <InvoiceNo>AR INV EGL-CM1-00045134</InvoiceNo>
    <DOC>470.0000</DOC>
    <FREIGHT>2305.1200</FREIGHT>

    <intFreightExcelCode>3</intFreightExcelCode>
    <InvoiceNo>AR INV EGL-CM1-00034567</InvoiceNo>
    <DOC>340.0000</DOC>
    <FREIGHT>2655.1200</FREIGHT>
    </tblFreight_Excel_Upload>

    Monday, October 14, 2019 5:03 AM

All replies

  • Hi Team,

    Anybody Can you Support on this above matter.

    Thanks


    Monday, October 14, 2019 10:40 AM
  • There are two options to map multiple source XML documents to a single XML document. The first is by constructing an 'envelope' source message that contains all the source XML documents. The second option is to pass the source XML documents as XSLT parameters (see #3 & #4 here on how to accomplish this).
    Monday, October 14, 2019 1:48 PM
  • Hi DBS14 and Team,

    Thank you for your info, yes my choose is XSLT method, But base on that info i'm tried to modify my current XSLT, but i'm unable to create it, Could you please support to modify my current XSLT to multiple type xslt?

    Current single xml mapping sample xslt-

    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cw="http://www.cawse.com/Schemas/Universal/2011/11" exclude-result-prefixes="cw">
    <xsl:output indent="yes" method="xml"/>

    <xsl:template match="/cw:UniversalInterchange">
    <tblFreight_Excel_Upload>
    <intFreightExcelCode>1</intFreightExcelCode>
    <InvoiceNo>
    <xsl:value-of select="cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:DataContext/cw:DataSourceCollection/cw:DataSource/cw:Key"/>
    </InvoiceNo>
    <DOC>

    <xsl:value-of select="format-number(sum(cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:PostingJournalCollection/cw:PostingJournal[contains('_DO_DDOCU_IOUDDOCUM_', concat('_',cw:ChargeCode/cw:Code,'_'))]/cw:ChargeTotalAmount), '#.0000')"/>
    </DOC>
    <FREIGHT>

    <xsl:value-of select="format-number(sum(cw:Body/cw:UniversalTransaction/cw:TransactionInfo/cw:PostingJournalCollection/cw:PostingJournal[contains('_CONGESC_FRT_GRI_PIER_', concat('_',cw:ChargeCode/cw:Code,'_'))]/cw:ChargeTotalAmount), '#.0000')"/>
    </FREIGHT>


    </tblFreight_Excel_Upload>
    </xsl:template>
    </xsl:stylesheet>

    Thanks


    Monday, October 14, 2019 2:47 PM
  • Hi Team,

    Anybody can you support on this matter...

    Thanks


    Monday, October 21, 2019 6:47 AM
  • I have used a single XSLT with multiple different root xsl template match elements to be able to use it for more than one type of input file. This works great for handling multiple EDI input formats in the same map. Thanks,

    If this answers your question, please use the "Answer" button to say so | Ben Cline

    Tuesday, October 22, 2019 9:36 PM
  • Hi Ben,

    Can you please give a sample xslt map for multiple xmls to single xml mapping. with LA workflow sample.

    Thanks

    Thursday, October 24, 2019 2:59 PM
  • Hi Team,

    Anybody can you support on this matter, i want a guidance to marge multiple xml data and transform xml to specific format.

    Thanks

    Sunday, October 27, 2019 10:18 AM