更新 XML 文档
我想使用节点
更新 XML 文档,其中 Path="\Package.Variables[User::LastRunDate].Properties[Value]" ValueType="DateTime"> ;
有人可以分享一些代码来用所需的节点更新 XML 文档吗?
<?xml version="1.0"?>
<DTSConfiguration>
<DTSConfigurationHeading>
<DTSConfigurationFileInfo GeneratedBy="contoso\johnR" GeneratedFromPackageName="UserPrefUtility" GeneratedFromPackageID="{E8B9B96A-7A1F-4DE9-9814-0B9F290CF021}" GeneratedDate="10/25/2010 4:15:43 PM"/>
</DTSConfigurationHeading>
<Configuration ConfiguredType="Property" Path="\Package.Connections[HYDCRMTRN01.InsphereModelTest_Custom].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=contoso;Initial Catalog=contosodb;Provider=SQLNCLI10.1;Integrated Security=SSPI;Application Name=SSIS-UserPrefUtility-{0E1E1762-E9E4-453E-8D4A-3760E77292B3}contoso.contosodb;Auto Translate=False;</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="\Package.Variables[User::CreateLogs].Properties[Value]" ValueType="String">
<ConfiguredValue>true</ConfiguredValue>
</Configuration>
**<Configuration ConfiguredType="Property" Path="\Package.Variables[User::LastRunDate].Properties[Value]" ValueType="DateTime">
<ConfiguredValue>1/15/2012 2:32:00 AM</ConfiguredValue>
</Configuration>**
<Configuration ConfiguredType="Property" Path="\Package.Variables[User::SdkUrl].Properties[Value]" ValueType="String">
<ConfiguredValue>http://contoso/MSCrmServices/2007/CrmService.asmx</ConfiguredValue>
</Configuration>
</DTSConfiguration>
I want to update an XML Document with the node <ConfiguredValue>
where Path="\Package.Variables[User::LastRunDate].Properties[Value]" ValueType="DateTime">
Can somebody please share some code to update XML document with desired node?
<?xml version="1.0"?>
<DTSConfiguration>
<DTSConfigurationHeading>
<DTSConfigurationFileInfo GeneratedBy="contoso\johnR" GeneratedFromPackageName="UserPrefUtility" GeneratedFromPackageID="{E8B9B96A-7A1F-4DE9-9814-0B9F290CF021}" GeneratedDate="10/25/2010 4:15:43 PM"/>
</DTSConfigurationHeading>
<Configuration ConfiguredType="Property" Path="\Package.Connections[HYDCRMTRN01.InsphereModelTest_Custom].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=contoso;Initial Catalog=contosodb;Provider=SQLNCLI10.1;Integrated Security=SSPI;Application Name=SSIS-UserPrefUtility-{0E1E1762-E9E4-453E-8D4A-3760E77292B3}contoso.contosodb;Auto Translate=False;</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="\Package.Variables[User::CreateLogs].Properties[Value]" ValueType="String">
<ConfiguredValue>true</ConfiguredValue>
</Configuration>
**<Configuration ConfiguredType="Property" Path="\Package.Variables[User::LastRunDate].Properties[Value]" ValueType="DateTime">
<ConfiguredValue>1/15/2012 2:32:00 AM</ConfiguredValue>
</Configuration>**
<Configuration ConfiguredType="Property" Path="\Package.Variables[User::SdkUrl].Properties[Value]" ValueType="String">
<ConfiguredValue>http://contoso/MSCrmServices/2007/CrmService.asmx</ConfiguredValue>
</Configuration>
</DTSConfiguration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(老实说,没有更多的上下文来回答这个问题——你想修改
使用 xslt 或使用 Java/DOM 或其他方式编写文档——这也是一个很好的答案
和任何人一样。 )
( honestly, without more context to the question -- do you want to modify the
document with xslt or using Java/DOM or whatever -- that's as good an answer
as any. )