I'm attempting to try and wrap all nodes between two processing instructions but it is tricky due to the nature and placement of the PI's:
Sample input data:
<content>
<p>Para 1 <?start?>changes <i>here</i></p>
<x>Para 2 <b>changes</b> here <?end?> and continues here</x>
<y>Para 3 here</y>
<z>Para <?start?>4 here <i>with more</i> tags</z>
<a>Para 5 starts here</a>
<b>Para 6 starts here</b><?end?>
</content>
Desired output:
<content>
<p>Para 1 <ins>changes <i>here</i></ins></p>
<x><ins>Para 2 <b>changes</b> here </ins> and continues here</x>
<y>Para 3 here</y>
<z>Para <ins>4 here <i>with more</i> tags</ins></z>
<a><ins>Para 5 starts here</ins></a>
<b><ins>Para 6 starts here</ins></b>
</content>
For the and pi's I would like to wrap all the nodes between them in a element.
The PI's can also be in part of any element, which adds another wrinkle to this.
The tricky issue here is that the <?start?> and <?end?> pi's can start in one element and end in another element (see elements p and x in sample input), in which case I would need to wrap each element in each own <ins> tag (to create valid xml) and then start again on the next element until it hits the <?end?> pi. Any way to achieve my desired output with XSLT 2.0?
<p>? - michael.hor257k