连接多个 XML 个文件
Comcatenate multiple XML files
我的 Azure BLOB 存储帐户中有超过 1 个 XML 文件,它们都具有相同的格式,是否可以使用 Logic App 将它们全部连接到一个 XML 文件中?我试过使用 concat 但它超过了 104,857,600 个字符的限制,所以我真的需要附加到现有的 BLOB 文件,但我似乎只能选择 create/update 来覆盖它。
例如,文件 1 可能如下所示:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456777">
<custom-attributes>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="en-US">Green</custom-attribute>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="de-DE">Grün</custom-attribute>
</custom-attributes>
</offer>
</enfinity>
而文件 2 可能如下所示:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456">
<variations>
<mastered-products>
<mastered-product sku="123456777" domain="WhiteStuff-MasterRepository"/>
<mastered-product sku="123456888" domain="WhiteStuff-MasterRepository"/>
</mastered-products>
</variations>
</offer>
</enfinity>
我知道一个有 <custom-attributes>
,另一个有 <variations>
,但需要附加的是 <offer sku=>
块,因此整个文件看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456777">
<custom-attributes>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="en-US">Green</custom-attribute>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="de-DE">Grün</custom-attribute>
</custom-attributes>
</offer>
<offer sku="123456">
<variations>
<mastered-products>
<mastered-product sku="123456777" domain="WhiteStuff-MasterRepository"/>
<mastered-product sku="123456888" domain="WhiteStuff-MasterRepository"/>
</mastered-products>
</variations>
</offer>
</enfinity>
如果有帮助,出现在一个文件中的 SKU 永远不会出现在单独的文件中。
根据您的共同要求,我复制了相同的内容,这对我来说是这样的:
我已经从存储中检索了 blob > 添加了具有 json 功能的 Compose Connector > 然后将其解析为 json > 然后使用 Customized json 合并为一个并添加值因此
以下是流程截图,供大家参考:
最后您需要再次将变量转换为 XML 以获得您需要的格式
参考资料:
我的 Azure BLOB 存储帐户中有超过 1 个 XML 文件,它们都具有相同的格式,是否可以使用 Logic App 将它们全部连接到一个 XML 文件中?我试过使用 concat 但它超过了 104,857,600 个字符的限制,所以我真的需要附加到现有的 BLOB 文件,但我似乎只能选择 create/update 来覆盖它。
例如,文件 1 可能如下所示:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456777">
<custom-attributes>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="en-US">Green</custom-attribute>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="de-DE">Grün</custom-attribute>
</custom-attributes>
</offer>
</enfinity>
而文件 2 可能如下所示:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456">
<variations>
<mastered-products>
<mastered-product sku="123456777" domain="WhiteStuff-MasterRepository"/>
<mastered-product sku="123456888" domain="WhiteStuff-MasterRepository"/>
</mastered-products>
</variations>
</offer>
</enfinity>
我知道一个有 <custom-attributes>
,另一个有 <variations>
,但需要附加的是 <offer sku=>
块,因此整个文件看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" major="6" minor="1" family="enfinity" branch="enterprise" build="build" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt">
<offer sku="123456777">
<custom-attributes>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="en-US">Green</custom-attribute>
<custom-attribute name="parentcolour" dt:dt="string" xml:lang="de-DE">Grün</custom-attribute>
</custom-attributes>
</offer>
<offer sku="123456">
<variations>
<mastered-products>
<mastered-product sku="123456777" domain="WhiteStuff-MasterRepository"/>
<mastered-product sku="123456888" domain="WhiteStuff-MasterRepository"/>
</mastered-products>
</variations>
</offer>
</enfinity>
如果有帮助,出现在一个文件中的 SKU 永远不会出现在单独的文件中。
根据您的共同要求,我复制了相同的内容,这对我来说是这样的:
我已经从存储中检索了 blob > 添加了具有 json 功能的 Compose Connector > 然后将其解析为 json > 然后使用 Customized json 合并为一个并添加值因此
以下是流程截图,供大家参考:
最后您需要再次将变量转换为 XML 以获得您需要的格式
参考资料: