I want to repeat the following lines in an XML document n times, n being set in the variable $n
|
|
Here's one option. In the example, the element generate will be replaced by the string $n number of times. I'm using DOE (disable-output-escaping) so the string is actual XML in the output. If it's supposed to be a string, just remove the DOE attribute.
XML Input
XSLT 1.0
WSCEAllergens[i]
]]>
XML Output
(Formatted after transform. Actual output would be on a single line because of the normalize-space().)
|
WSCEAllergens[0]
|
WSCEAllergens[1]
|
WSCEAllergens[2]
|
Also note that the namespace prefix ss should be bound to a namespace in the output.