使用 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 输出所有匹配节点(无论路径如何),属性为check="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。任何帮助,将不胜感激。