xml - 连接多个 XML 文件
问题描述
我的 azure BLOB 存储帐户中有超过 1 个 XML 文件,它们都具有相同的格式,是否可以使用 Logic App 将它们全部连接成一个 XML 文件?我试过使用 concat 但它超过了 104,857,600 个字符的限制,所以我真的需要附加到现有的 BLOB 文件,但我似乎只有创建/更新的选项,它们都覆盖它。
例如,文件 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 连接器 > 然后将其解析为 json > 然后使用自定义 json 合并为一个并相应地添加值
这是流程的屏幕截图供您参考:
最后,您需要再次将变量转换为 XML 以获得所需的格式
推荐阅读
- ios - 将数据从 UIViewController 传递到 UITabBarController 始终为零
- flutter - 是否可以在飞镖中动态设置方法的返回类型
- python - 在 Android Studio 中使用 Chaquopy 将值插入到 python 文件中
- vba - 从抓取的表格中提取单元格值的最有效方法
- c# - 是否可以在 HwndHost 中托管 WPF 页面?
- chart.js - 如何在工具提示回调afterBody中将逗号分隔的字符串分成新行?
- stata - 在stata矩阵中生成新列
- python - I am trying to call information on venues in a 500 m radius of a location via the foursquare API. I keep getting getting the error: [WinError 10061]
- javascript - How to use chartkick and vue in html?
- flutter - how to config ignore null check in release mode with flutter build