I’ve got a question about copying some xml, with xslt.
I have xml that sometimes contains Parent nodes with an iteration. They look like this.
<opdracht iteration="1">
<a> 1 </a>
<b> 1 </b>
</opdracht>
<opdracht iteration="2">
<a> 1 </a>
<b> 1 </b>
</opdracht>
<opdracht iteration="3">
<a> 1 </a>
<b> 1 </b>
</opdracht>
If i choose 3 items, the xml will build 3 iterated nodes. But if I choose 5 of 6 items, it generates 5 or 6 different xml iterations.
I need to make some XSLT that allows me to copy these parent and child Iterated nodes, for as long as they are iterated. And output them under the same original name. So :
<opdracht iteration="1"> Becomes <opdracht>
And
<opdracht iteration="2"> becomes also <opdracht>
And so forth….
How do I do this?
I don’t fully understand the question, but I “think” you are saying you want to copy the XML, but remove the @iteration attribute from the opdracht elements.
If that is the case, you can do it with a simple extension to the XSLT identity transform
When applied to the following XML
The following is output: