0

I want to create an XML file. I have to pick some information from another XML file and INI file. This is the XML file

<?xml version="1.0" encoding="UTF-8"?>
<Group version="111">
    <Class code="WWWC_53307F" note="bPC">
        <Name note="Cubano - Rebuild 1" studentID="872C/8834">
            <major name="rt640x64" />     
        </Name>             
        <Name note="Doppio - Rebuild 1" studentID="872E/8836">
            <major name="rt640x64" version="11182019,10.038.1118.2019" />     
        </Name>     
    </Class>
    <Class code="WWWC_53316J" note="cPC">
        <Name note="Fangio 1.2" studentID="81B7/82DC/81B8/81B9">
            <major name="rt640x64" />
        </Name>
        <Name note="Typhon 1.1 - rebuild 1" studentID="81B6/8268/82E0">
            <major name="asmthub3" />
        </Name>
        <Name note="Willow" studentID="822A/82D7">
        </Name>
        <Name note="Shave Rebuild 1" studentID="2B5B">
    </Class>
</Group>

The ini file there are two type. I have more than 1 ini file.

[Name]
Name = NB A
String = Defaults and Exit

[Controller1]
Desc = Embedded SATA 

[Controller2]
Desc = Intel Optane Device

[Name]
Name = NB A
String = Defaults and Exit

[Controller1]
Desc = Embedded SATA 

My expectation output of new XML is like this

<Group version="22">
    <Name code="WWWC_53307F" note="bPC">
        <Pro Name="DM System" SSID="8594">
            <Controller ControllerType="Embedded SATA"/>
            <Controller Controllertype="Intel Optane Device"/>
        </Pro>
    </Name>
    <Name code="WWWC_53316J" note="cPC">
        <Pro Name="DM System" SSID="8594">
            <Controller ControllerType="Embedded SATA" />
        </Pro>
</Gr

Group>

Anyone can give idea please helpe. Thank you

5
  • Oh I was just about to answer your last question about the INI file but you deleted it. Commented Apr 23, 2020 at 7:07
  • Hi, sorry, I just create the simple one to easy to understand. If you don;t mind, can share it here. THank you @RoadRunner Commented Apr 23, 2020 at 7:10
  • I would share it but it seems like you want something very different here. Commented Apr 23, 2020 at 7:13
  • @RoadRunner I undelete the queestion stackoverflow.com/q/61378712/11076819 Commented Apr 23, 2020 at 7:20
  • 1
    How do you get attributes like Name="DM System" SSID="8594"? These values are nowhere to be found in the example ini, so how can this info-from-nowhere possibly match code="WWWC_53307F" ?? Commented Apr 23, 2020 at 18:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.