我有一长串带有命名标识符的 XML 值。我需要为每个组合在一起并唯一命名的不同标识符制作单独的输出文件。
因此,例如,假设我有:
<List>
<Item group="::this_long_and_complicated_group_name_that_cannot_be_a_filename::">
Hello World!
</Item>
<Item group="::this_other_long_and_complicated_group_name_that_cannot_be_a_filename::">
Goodbye World!
</Item>
<Item group="::this_long_and_complicated_group_name_that_cannot_be_a_filename::">
This example text should be in the first file
</Item>
<Item group="::this_other_long_and_complicated_group_name_that_cannot_be_a_filename::">
This example text should be in the second file
</Item>
<Item group="::this_long_and_complicated_group_name_that_cannot_be_a_filename::">
Hello World!
</Item>
</List>
如何编写转换 (XSLT 2.0) 以将这些分组输出为生成的文件名并具有唯一值?例如:将第一个映射@group
到 file1.xml,第二个映射@group
到 file2.xml