How to transform adjacent XML lists using XSLT

knotas

New Member
I've been using XSLT to clean up some legacy XML code into a cleaner format. Here's a case I haven't figured out a proper solution to. The starting XML looks like this:\[code\]<MyPoints> <X_Values> <X>11</X> <X>12</X> <X>13</X> </X_Values> <Y_Values> <Y>21</Y> <Y>22</Y> <Y>23</Y> </Y_Values></MyPoints>\[/code\]Here's what I would like to get:\[code\]<MyPoints> <Values> <Value X="11" Y="21" /> <Value X="12" Y="22" /> <Value X="13" Y="23" /> </Values></MyPoints>\[/code\]X_Values and Y_Values are guaranteed to have the same number of elements. I want to do this for 3D points as well, but that should be a trivial extension of the solution.XSLT 1.0 would be nice if possible.
 
Back
Top