I have xml
:
<Root>
<A>
<B>X</B>
<C>Y</C>
<D>Z</D>
</A>
</Root>
With use of xslt
transform, I need to get this:
<Root>
<Wrap type="B">
<A>
<B>X</B>
</A>
</Wrap>
<Wrap type="C">
<A>
<B>Y</B>
</A>
</Wrap>
<Wrap type="D">
<A>
<B>Z</B>
</A>
</Wrap>
</Root>
What kind of xsl::select
should I use? And how to modify just created elements in xsl
.
EDIT: correct typo, question updated. I add another one element to a list, now it is the list of A, that should be classified.
<Root>
<A>
<B>X</B>
<C>Y</C>
<D>Z</D>
</A>
<A>
<B>X1</B>
<C>Y1</C>
<D>Z1</D>
</A>
</Root>
And now I want to get
<Root>
<Wrap type="B">
<A>
<B>X</B>
<B>X1</B>
</A>
</Wrap>
<Wrap type="C">
<A>
<B>Y</B>
<B>Y1</B>
</A>
</Wrap>
<Wrap type="D">
<A>
<B>Z</B>
<B>Z1</B>
</A>
</Wrap>
</Root>
Use This