以下是我的示例 XML 文件:-
我只想在 C# 中使用 LINQ to XML 将日期值替换为当前日期。
<?xml version="1.0" encoding="UTF-8"?>
<BasicImport xmlns="http://www.uk.SSp.com/SSR/XTI/Traffic/0010" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.uk.nds.com/SSR/XTI/Traffic/0010 0010.xsd" utcOffset="+05:30" frameRate="25">
<SiEventSchedule deleteStart="2012/01/21 00:00:00" deleteEnd="2012/01/21 23:59:59">
<siService>Ssp</siService>
<playoutSource>Ssp</playoutSource>
<activationSourceId>0</activationSourceId>
<CaSchedule deleteStart="2012/01/21 00:00:00" deleteEnd="2012/01/21 23:59:59" />
<SiEvent>
<displayDateTime>2012/01/21 00:00:00</displayDateTime>
<activationDateTime>2012/01/21 00:00:00</activationDateTime>
<displayDuration>00:30:00</displayDuration>
<siTrafficKey>056049263</siTrafficKey>
<detailKey>056049263 2012-07-12</detailKey>
</SiEvent>
</SiEventSchedule>
</BasicImport>