- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
VS2010 中大多数文件类型(例如 .cs、.xml、.xslt)的“属性”窗口允许指定用于转换文件的自定义工具。作为引用,这里是选择“自定义工具”字段时获得的工具提示。
Specifies the tool that transforms a file at design time and places the output of that transformation into another file. For example, a dataset (.xsd) file comes with a default custom tool.
我正在查找有关如何设置和使用此属性的信息。
这是我要解决的问题。我正在通过应用 XSLT 转换 XML 文件。我在转换期间使用扩展对象,如所述 here .
在这样做的过程中,我使 Visual Studio 无法用作编辑和调试 XSLT 的工具。我希望我可以编写一个简单的转换引擎,使我们能够像处理不使用扩展对象的 XSLT 文档一样使用 Visual Studio。我认为(希望)自定义工具属性是完成这项工作的关键。
TIA
最佳答案
使用扩展函数调试 XSLT 转换,能够在 XSLT 代码和扩展函数代码中设置断点,因为 VS2005 已经支持。
只需使用 this XslCompiledTransform constructor过载。
参数启用调试类型:System.Booleantrue 生成调试信息;否则为假。将此设置为 true 使您能够使用 Microsoft Visual Studio 调试器调试样式表。
必须满足以下条件才能单步执行代码并调试样式表:
enableDebug
参数设置为 true。
样式表被传递给Load
方法作为 URI,或XmlReader
类的实现实现了 IXmlLineInfo
界面。 IXmlLineInfo
接口(interface)在所有文本解析上实现XmlReader
对象。
换句话说,如果样式表是使用 IXPathNavigable
加载对象,例如 XmlDocument
或XPathDocument
,或 XmlReader
不执行实现 IXmlLineInfo
接口(interface),您无法调试样式表。
XmlResolver
用于加载样式表是基于文件的XmlResolver
,例如XmlUrlResolver
(这是默认的XmlResolver
使用的XslCompiledTransform
类)。
样式表位于本地机器或 Intranet 上。
这是一个小代码示例:
// Enable XSLT debugging.
XslCompiledTransform xslt = new XslCompiledTransform(true);
// Load the style sheet.
xslt.Load("output.xsl");
// Create the writer.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent=true;
XmlWriter writer = XmlWriter.Create("output.xml", settings);
// Execute the transformation.
xslt.Transform("books.xml", writer);
writer.Close();
关于xml - 如何指定 "Custom Tool"以在 VS2010 中转换文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4737997/
我想使用 Google OR-Tools 解决车辆路径问题 (vrp),但使用与提供的元启发式不同的元启发式,它们是:贪婪下降、引导局部搜索、模拟退火、禁忌搜索和目标禁忌搜索。这就是此处文档中的解释:
对于 or-tools 中的 VRP,有没有办法让车辆从某些固定位置开始,但允许任意结束位置? 文档 https://developers.google.com/optimization/routin
我创建了新文件“Makefile.local”,并将“WINDOWS_SCIP_DIR=c:/Program Files/SCIPOptSuite”添加到文件中。 SCIP也编译成功,文件路径正确。
这个问题在这里已经有了答案: What are the Android SDK build-tools, platform-tools and tools? And which version sh
我正在尝试在 OR-TOOLS RL VRPTW 问题中强制执行位移长度约束。类次时长是车辆在服务中的总时间(运输 + 等待 + 服务),从到达第一个位置到离开最后一个位置。 它看起来像一个 Time
我正在尝试在 OR-TOOLS RL VRPTW 问题中强制执行位移长度约束。类次时长是车辆在服务中的总时间(运输 + 等待 + 服务),从到达第一个位置到离开最后一个位置。 它看起来像一个 Time
命令后: go build 显示错误: go tool: no such tool "link" 详细信息:我的系统是 windows 10 -> 64 位 go version: 1.11.5
我已经在我的 Ubuntu 桌面上安装了 go,在我关闭计算机之前它运行良好。 现在,当我启动我的机器并继续我的项目工作时,我明白了 $ go build go tool: no such tool
我正在为 Job-Shop 问题实现一个类似的解决方案,但有一个区别:我不知道必须执行每项任务的机器。解决这个问题也是问题的一部分。事实上,我们可以说,我正在尝试解决护士问题和工作车间问题的组合。 更
我知道Spring Tool Suite是为Spring开发而优化的,而Groovy / Grails是为Groovy / Grails开发的而优化的。 Groovy / Grails开发人员是否愿意
在 Chrome Dev Tools 中,我可以 Shift+单击检查器中的颜色来更改格式(Hex -> RGB -> HSL)。我可以在 Firefox Dev Tools 中做到这一点吗?我可以在
我目前正在评估谷歌或工具,只是注意到它本身并不是真正的求解器,而主要是与其他求解器的接口(interface)。我想知道的是这个框架使用哪些求解器来解决约束和路由问题。 我已经看透了https://d
我正在尝试使用命令 firebase init 初始化 Firebase 项目,但我收到消息 Error: Command requires authentication, please run fi
是什么决定了工具进入特定目录?例如,adb 位于 tools/但已移至 platform-tools/。为什么他们不能在同一个目录中? 最佳答案 platform-tools/ 主要包含从 Windo
我刚刚将 Android Studio 更新到了 2.3 版(金丝雀版)和最后的构建工具 'com.android.tools.build:gradle:2.3.0-alpha1' 以及当我打开布局并
我一直在使用 SQL Server 项目来管理数据库的结构。 首先我创建了项目,然后导入了一个数据库。 然后,当我需要更改架构时,比如更改字段名称,我会在 SQL Server 项目中进行,然后使用架
我正在尝试使用 Google OR-Tools 的 CP-Solver 解决问题。是否可以添加这样的约束:x1 异或 x2 异或 x3 == 0提前致谢。 最佳答案 AddBoolXOr of n 个
我需要为此获取源代码,但不幸的是,我无法在 jquerytools.org 上找到它的链接。该站点上的论坛也已关闭。有谁知道我可以从哪里获得这个来源或取消缩小它? 谢谢,罗布 最佳答案 你有没有试过继
我需要为此获取源代码,但不幸的是,我无法在 jquerytools.org 上找到它的链接。该站点上的论坛也已关闭。有谁知道我可以从哪里获得这个来源或取消缩小它? 谢谢,罗布 最佳答案 你有没有试过继
我正在使用Spring Tool Suite: 版本:3.9.0.RELEASE 建立编号:201707061903 平台:Eclipse Neon.3(4.6.3) 并安装了Gradle插件: Bu
我是一名优秀的程序员,十分优秀!