Transform XML to another XML Document

admin

Administrator
Staff member
I've tried countless ways to transform this XML Document using XSLT but I can't seem to get it correct.

Here is my original XML.

<DSCRatingResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://192.168.132.8/DSCRequest">
<DSCVehicleOptions>
<DSCVehicleOption Name="All Wheel Drive" OptID="1" Applied="0" />
<DSCVehicleOption Name="Four Wheel Drive" OptID="4" Applied="0" />
</DSCVehicleOptions>
<DSCCoverages>
<DSCCoverage CvgID="4300" Name="Platinum" VehClass="2" />
<DSCCoverage CvgID="4301" Name="Premium" VehClass="2" />
</DSCCoverages>
</DSCRatingResult>

An example of how I would like it to look:

<DSCRatingResultTest>
<DSCVehicleOptionsTest>
<DSCVehicleOptionTest NameTest="All Wheel Drive" OptIDTest="1" AppliedTest="0" />
<DSCVehicleOptionTest NameTest="Four Wheel Drive" OptIDTest="4" AppliedTest="0" />
</DSCVehicleOptionsTest>
<DSCCoveragesTest>
<DSCCoverageTest CvgIDTest="4300" NameTest="Platinum" VehClassTest="2" />
<DSCCoverageTest CvgIDTest="4301" NameTest="Premium" VehClassTest="2" />
</DSCCoveragesTest>
</DSCRatingResultTest>

I'd post some of my attempts but at this point I can't tell which one I've made progress on or not. Thank you in advance for any assistance.
 
Back
Top