2
使用XSL我想比較兩個文件並生成輸出文件。使用XSL比較兩個文件並生成輸出文件
文件1:
<SalesExtractProcess>
<PackageFormatVersion>3</PackageFormatVersion>
<VersionComments></VersionComments>
<CreatorName>Demouser</CreatorName>
<CreatorComputerName>DemoComputer</CreatorComputerName>
<CreationDate>10/1/2012 9:00:09 AM</CreationDate>
<PackageType>5</PackageType>
<Configurations>
<SalesConfigurations>
<ConfigurationType>1</ConfigurationType>
<ConfigurationString>SalesExtractPackageConfig.dtsConfig</ConfigurationString>
<ConfigurationVariable></ConfigurationVariable>
</SalesConfigurations>
</Configurations>
<SalesExtractProcess>
文件2:
<Package>
<PackageFormatVersion checked="false">3</PackageFormatVersion>
<VersionComments checked="false"></VersionComments>
<CreatorName checked="true">Testuser</CreatorName>
<CreatorComputerName checked="true">TestComputer</CreatorComputerName>
<CreationDate checked="true">10/1/2012 9:00:09 AM</CreationDate>
<PackageType checked="false">5</PackageType>
<Configurations>
<Config>
<ConfigurationType checked="false">1</ConfigurationType>
<ConfigurationString checked="true">Package.dtsConfig</ConfigurationString>
<ConfigurationVariable checked="false"></ConfigurationVariable>
</Config>
</Configurations>
<Connections>
<LocalHost.AdventureWorks>
<ObjectName checked="true">LocalHost.AdventureWorks</ObjectName>
</LocalHost.AdventureWorks>
</Connections>
</Package>
我想比較文件1與文件2和從文件1輸出的所有匹配的節點(不管路徑的)將屬性checked =「true」複製到結果文件。我的結果文件應該是這樣
結果文件:
<SalesExtractProcess>
<CreatorName>Demouser</CreatorName>
<CreatorComputerName>DemoComputer</CreatorComputerName>
<CreationDate>10/1/2012 9:00:09 AM</CreationDate>
<Configurations>
<SalesConfigurations>
<ConfigurationString>SalesExtractPackageConfig.dtsConfig</ConfigurationString>
</SalesConfigurations>
</Configurations>
<SalesExtractProcess>
我不能弄清楚如何完成這個任務創建XSL。任何幫助,將不勝感激。
這就是我想要的目的。非常感謝你** nonnb **你拯救了我的一天。 –