I have an XML file, for example:
<?xml version="1.0" encoding="utf-8" ?> <LayoutControl ID="rootlyt" Type="LayoutControl"> <LayoutGroup ID="lgp8" Header="PersonalInfo" IsCollapsed="False" IsLocked="False" Orientation="Vertical" View="GroupBox" HorizontalAlignment="Left" VerticalAlignment="Top" Width="380" Height="295" Type="GroupItem" Properties="IsCollapsible=False,IsCollapsed=False,IsLocked=False,"> <Element ID="layout2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" Height="25" Label="Name" Background="#00FFFFFF" ContentName="txt2" Type="TextEdit" /> </LayoutGroup> </LayoutControl>
For some reason, I need to create child and nested nodes from Element node attributes .
The result I want:
<?xml version="1.0" encoding="utf-8" ?> <LayoutControl ID="rootlyt" Type="LayoutControl"> <LayoutGroup ID="lgp8" Header="PersonalInfo" IsCollapsed="False" IsLocked="False" Orientation="Vertical" View="GroupBox" HorizontalAlignment="Left" VerticalAlignment="Top" Width="380" Height="295" Type="GroupItem" Properties="IsCollapsible=False,IsCollapsed=False,IsLocked=False,"> <Element > <ID>layout2</ID> <HorizontalAlignment>Left</HorizontalAlignment> <VerticalAlignment>Top</VerticalAlignment> <Width>300</Width> <Height>25</Height> <Label>Name</Label> <Background>#00FFFFFF</Background> <ContentName>txt2</ContentName> <Type>TextEdit</Type> </Element> </LayoutGroup> </LayoutControl>
How can i do this?
Or any idea, link, article ...
Thanks.
source share