I have a xml document. I know the index where i need to insert the new node. The index that i have is the position considering only the text nodes and ignoring the element tags. Is there a java api to seek the index in a xml knowing the position relative to the text nodes alone and insert a new node in that position?
Share
The following XSLT 2.0 stylesheet is an attempt to extend the solution in the original XSLT 2.0 stylesheet to receive a list of index positions and nodes to be inserted with one transformation:
This stylesheet expects a file insert-data.xml to contain the data in the following format:
So each ‘data’ element contains the nodes to be inserted at the position given by the ‘index’ attribute.