Splitting elements with XSLT?
Posted: Tue Jun 01, 2010 4:10 pm
Hi!
Sitting with a document conversion/transformation where an element needs to split and I do not know how to handle it with XSL.
An example of input data:
An example of what I want to see in the output data:
The rule here is that only one graphic can exist in each container, so you want to match second graphic within a container and split the container.
What I like to do is match the second and put in this:
So I thought that a split-function, like for instance Arbortext Editor have, would solve the situation.
Any ideas someone?
Thanx!
Sitting with a document conversion/transformation where an element needs to split and I do not know how to handle it with XSL.
An example of input data:
Code: Select all
<document>
<container>
<p>TEXT HERE</p>
<graphic ref="test.eps"/>
<p>MORE TEXT</p>
<graphic ref="newtest.eps"/>
<p>EVEN MORE TEXT</p>
</container>
</document>
Code: Select all
<document>
<container>
<p>TEXT HERE</p>
<graphic ref="test.eps"/>
<p>MORE TEXT</p>
</container>
<container>
<graphic ref="newtest.eps"/>
<p>EVEN MORE TEXT</p>
</container>
</document>
What I like to do is match the second and put in this:
but that is not valid XML!</container>
<container>
So I thought that a split-function, like for instance Arbortext Editor have, would solve the situation.
Any ideas someone?
Thanx!