I have a long list of values in XML with named identifiers. I need to make separate output files for each of the distinct identifiers grouped together and uniquely named.
So, for example, let's say I have:
<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>
How can I write a transformation (XSLT 2.0) to output these grouped into generated filenames and uniquely valued? For example: mapping the first @group
to file1.xml and the second @group
to file2.xml