sql-server - 我有一个布局相同的 xml 文件文件夹。我想将它们合并到一个文件中。有什么建议可以通过 sql server 做到这一点吗?
问题描述
文件 1 输入:
<?xml version="1.0" encoding="utf-8"?>
<saw:ibot xmlns:saw="com.siebel.analytics.web/report/v1.1" version="1" priority="normal" xmlns:cond="com.oracle.bi/conditions/v1" xmlns:sawx="com.siebel.analytics.web/expression/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" jobID="79" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><saw:schedule timeZoneId="(GMT-08:00) Pacific Time (US & Canada); Tijuana"><saw:start startImmediately="false" date="2017-07-06" time="11:30:00"/><saw:recurrence runOnce="false"><saw:weekly weekInterval="2" thu="true"/></saw:recurrence></saw:schedule><saw:dataVisibility type="runAsUser" runAs="weblogic" runAsGuid="weblogic"/><cond:condition/><saw:choose><saw:when condition="true"><saw:deliveryContent disposition="attachment" format="excel2007"><saw:headline><saw:caption><saw:text>DO & RVP</saw:text></saw:caption></saw:headline><saw:reportRef path="/shared/BJs Analytics/Agent/Reports/Dana DO & RVP"/><saw:attachmentMessage><saw:caption><saw:text>DO & RVP Report</saw:text></saw:caption></saw:attachmentMessage></saw:deliveryContent><saw:postActions/></saw:when><saw:otherwise><saw:postActions/></saw:otherwise></saw:choose><saw:deliveryDestinations><saw:destination category="pcemail"/></saw:deliveryDestinations><saw:recipients specificRecipients="true" subscribers="false" customize="false"><saw:specificRecipients><saw:user name="dtaylor" guid="dtaylor"/><saw:user name="eluster" guid="eluster"/></saw:specificRecipients><saw:subscribers/></saw:recipients><saw:emailRecipients/></saw:ibot>
文件 2 输入:
<?xml version="1.0" encoding="utf-8"?>
<saw:ibot xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:cond="com.oracle.bi/conditions/v1" xmlns:sawx="com.siebel.analytics.web/expression/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" priority="normal" jobID="145" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><saw:schedule timeZoneId="(GMT-08:00) Pacific Time (US & Canada); Tijuana"><saw:start startImmediately="false" date="2017-07-06" time="11:30:00"/><saw:recurrence runOnce="false"><saw:weekly weekInterval="2" thu="true"/></saw:recurrence></saw:schedule><saw:dataVisibility type="runAsUser" runAs="weblogic" runAsGuid="weblogic"/><cond:condition/><saw:choose><saw:when condition="true"><saw:deliveryContent disposition="attachment" format="excel2007"><saw:headline><saw:caption><saw:text>Test Mail from bjri-obi-004</saw:text></saw:caption></saw:headline><saw:reportRef path="/shared/BJs Analytics/Agent/Reports/Dana DO & RVP"/><saw:attachmentMessage><saw:caption><saw:text>DO & RVP Report</saw:text></saw:caption></saw:attachmentMessage></saw:deliveryContent><saw:postActions/></saw:when><saw:otherwise><saw:postActions/></saw:otherwise></saw:choose><saw:deliveryDestinations><saw:destination category="pcemail"/></saw:deliveryDestinations><saw:recipients specificRecipients="true" subscribers="false" customize="false"><saw:specificRecipients><saw:user name="ereeh" guid="ereeh"/></saw:specificRecipients><saw:subscribers/></saw:recipients><saw:emailRecipients/></saw:ibot>
所需输出:
Is it possible to merge FILE 1 and FILE 2 XML via SQL query.
解决方案
为什么要为此使用 SQL Server?只需使用能够将文件夹作为集合访问的 XQuery 引擎(如 Saxon 或 BaseX),然后使用查询
<merged>{collection('/my/folder/')}</merged>
推荐阅读
- php - 我正在尝试在 laravel 中创建多个表用户和管理员登录,但出现错误
- kendo-ui - KendoUI (Telerik 2018) - TreeList 直到手动刷新才显示新创建的记录
- docker - 用于远程执行 Docker 操作的 Docker Rest API
- ruby-on-rails - Google recaptcha disappears after second click in the signup button on navbar
- nativescript - IOS 构建中的 nativescript 5.1 和 tns_modules 文件夹
- python - 通过 Eikon api 合并 CRSP 和 Eikon
- java - 为 orientDB 使用 vertex.setProperties() 函数时出错
- android - 无法在 Android Studio 上接受 sdk 许可证
- python - UnicodeEncodeError:“ascii”编解码器无法在打印函数中编码字符
- jquery - Fancybox 不能很好地与里面的表格一起工作