您好我正在尝试<cron-expression>
通过在quartz.net 作业描述文件上使用以下转换来替换使用VS2012 XDT。我已经使用在线测试器测试了 XPath 定位器,它返回“我认为我需要的东西”。任何帮助表示赞赏。
<schedule>
<trigger>
<cron xdt:Locator="XPath(//job-scheduling-data/schedule/trigger/cron[name='crontriggername2'])" >
<cron-expression xdt:Transform="Replace">***some data***</cron-expression>
</cron>
</trigger>
</schedule>
对于示例 XML 文件 (Quartz.net)
<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"><processing-directives>
<overwrite-existing-data>true</overwrite-existing-data>
</processing-directives>
<schedule>
<trigger>
<cron>
<name>crontriggername1</name>
<group>crontriggergroup1</group>
<description>crontriggerdesc1</description>
<job-name>crontriggerjobname1</job-name>
<job-group>crontriggerjgroup1</job-group>
<misfire-instruction>crontriggermisfile1</misfire-instruction>
<cron-expression>0/5 * * * * ?</cron-expression>
</cron>
</trigger>
<trigger>
<cron>
<name>crontriggername2</name>
<group>crontriggergroup2</group>
<description>crontriggerdesc2</description>
<job-name>crontriggerjobname2</job-name>
<job-group>crontriggerjgroup2</job-group>
<misfire-instruction>crontriggermisfile2</misfire-instruction>
<cron-expression>0/13 * * * * ?</cron-expression>
</cron>
</trigger>
</schedule>
XPath //job-scheduling-data/schedule/trigger/cron[name='crontriggername2']
返回我正确的元素组(http://www.freeformatter.com/xpath-tester.html 1)
<cron>
<name>crontriggername2</name>
<group>crontriggergroup2</group>
<description>crontriggerdesc2</description>
<job-name>crontriggerjobname2</job-name>
<job-group>crontriggerjgroup2</job-group>
<misfire-instruction>crontriggermisfile2</misfire-instruction>
<cron-expression>0/13 * * * * ?</cron-expression>
</cron>
我将表达式基于 Log4net 上另一个 XDT 问题的解决方案(log4Net 配置转换)
谁能指出我正确的解决方案,这让我发疯。提前致谢。