After reading around Google search results, and experimenting a bit I'm stuck with trying to renumber elements in an XML source via XSLT.
If I have something like:
<something uid="1" />
<something uid="2" />
<something uid="3" />
What would be the most straight-forward XSLT code to allow me to pass in a parameter to allow me to insert an element between uid's 1 and 2, giving it's uid attribute the value of "2" (ie: the same value as the element it is inserted before) and renumbering the subsequent elements' uid attributes accordingly to give me:
<something uid="1" />
<something uid="2" /> - this is the newly inserted element
<something uid="3" /> - this was formally UID="2"
<something uid="4" /> - this was formally UID="3"
Note that uid="1" remains constant, it is only uid="2" and uid="3" that get renumbered to allow for the newly inserted element.
Thanks
If I have something like:
<something uid="1" />
<something uid="2" />
<something uid="3" />
What would be the most straight-forward XSLT code to allow me to pass in a parameter to allow me to insert an element between uid's 1 and 2, giving it's uid attribute the value of "2" (ie: the same value as the element it is inserted before) and renumbering the subsequent elements' uid attributes accordingly to give me:
<something uid="1" />
<something uid="2" /> - this is the newly inserted element
<something uid="3" /> - this was formally UID="2"
<something uid="4" /> - this was formally UID="3"
Note that uid="1" remains constant, it is only uid="2" and uid="3" that get renumbered to allow for the newly inserted element.
Thanks