问题标签 [xdt]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net - 用于匹配缺失属性的 XML 文档转换 (XDT) 定位器
假设我有以下 XML:
我需要对此进行 XML 转换。
我将如何做一个xdt:Locator
匹配或第一个?第二个呢?
我试着做xdt:Locator="Match(name)"
,我得到一个错误,没有“名称”属性。(我曾希望如果该属性不存在,它会优雅地为匹配返回 false。)
.net - 用于查找和替换值的 XML 文档转换
我有一个 xml 文档,其中包含一个 sql 查询。假设它看起来像这样:
当它通过 octopack 运行并部署(通过 octopus deploy)到我的服务器上时,它看起来像这样:
(换行符被转换为

)
在进行此更改以将其转换回来后,我是否可以运行 xml 转换?(或至少删除

)
注意:我的实际查询是一个复杂的合并语句,所以我宁愿不要将它放在多个地方。
xml - xdt 转换添加冗余命名空间
在使用 xml 模式命名空间的 xml 文件上使用 xdt 转换时,是否有任何方法不添加替换元素的冗余命名空间?
输入:
转换:
输出:
我也尝试过使用 XPath 定位器,结果相同。转换:
我想要这个输出:
可以使用 xdt 吗?
xml - 用于 c# Windows Store / Metro / win-store 应用程序的 Slowcheetah XML 转换
我已经从扩展库安装了 SlowCheetah,然后从 nuget(然后从 nuget 卸载并重新安装)。
有用 ! 几乎 ;)
那就是它正在转换相关文件并将它们复制到 bin/[nameofconfig eg Debug / Release]/ 文件夹
但是,在本地运行应用程序时,使用的文件是在例如
D:\Projects[项目名称]\bin\Debug\ AppX
并且这个文件仍然是原始的未转换文件。
当我按下 F5 时,最简单的方法是什么, 因为扩展描述声称它应该(对于 win 商店应用程序)。
我猜 .csproj 中的复制文件任务可以解决问题 - 有人成功完成了吗?
asp.net - Web.config transformation locator condition or xpath not working with multiple attributes
I'm using Microsoft's XDT library to transform my web.config files and discovered that Locator is not working as expected. Using the example below, I would expect that both the attributes are set and the converter node is inserted in all three appenders, but only the attributes are updated in all three. The converter node is only inserted into the first appender. How do I get it to insert into all three log4net appender nodes?
I've tried switching to XPath, but it only throws errors. A working example would be nice, because every example I've followed so far seems to fail with an error.
Test site: https://webconfigtransformationtester.apphb.com/
For example:
Web.config
Web.Debug.config
Results:
asp.net - Xdt 转换以将安全模式添加到多个绑定
我的 Web 应用程序使用多个 Web 服务,因此我对每个服务都有绑定,如下所示:
在我的开发环境中,我不能使用 SSL(也不需要它),但是当我去部署时,我必须使用 SSL,所以我需要为每个绑定添加一个安全模式。我应用了以下 XDT 转换:
但这只会将安全模式添加到第一个绑定中。但即使在阅读了XDT Transform 文档和大量文章以及 SO 问题/答案之后,我仍然无法弄清楚如何指定一个定位器来选择所有绑定,以便将子节点添加到所有绑定中。我可以按名称指定每个绑定,但这似乎很笨拙。有任何想法吗?
xdt-transform - 带有命名空间的 XDT 变换属性
我正在为 xamarin.android 开发 nuget 包,我需要转换 AndroidManifest.xml 我需要将 android:sharedUserId 属性添加到名为 manifest 的根元素
所以我可以将属性添加到根节点
但命名空间'android'被遗漏了。如何将命名空间添加到属性?
xml - 可以附加 web.config 的 XDT 转换
我正在尝试更新我的 web.config 中的现有 appSettings。我不想替换整个值,而是将我的新值附加到末尾。这可能吗?
当前值:
所需值:
这是我目前在我的转换文件中的内容:
nuget - XDT 转换消除了错误的输入
在 NuGet 中使用之前,我正在使用这个站点来测试我的 XDT 转换。当我有这个配置
并使用此转换:
结果是这个输出:
我不明白为什么条目 ApplicationInsightsWebTracking 被删除而不是 ErrorLog。在 NuGet 包中使用此转换时(删除包时),我得到了相同的结果。如何改变工作中的转换?
xdt-transform - 基于兄弟元素值应用 XDT 变换
鉴于此 XML 配置文件:
我想<cron-expression>
为Trigger2
.
使用此转换:
当项目构建时,我看到编译器警告:
源文档中没有元素匹配“/job-scheduling-data/schedule/trigger/cron[name='Trigger2']”。
XPath 查询似乎是正确的,但从未应用该规则(因此出现编译器警告)。
我的项目配置为使用 Visual Studio 2015 中的 TransformXml 任务在构建时进行转换。
难道我做错了什么?