rewrite xml by attributes with path

wheresmy40

New Member
although I have seen and read many posts about how to convert attributes to elements no example does what I need.I have a flat xml and will convert it to a full tree oriented xml:Input:\[code\]<Subsystem Name="Device Monitor"><Group Name="ITCHealth"> <Field Name="System\AttachedDevice\OneWire\Count" Type="Integer">0</Field> <Field Name="System\AttachedDevice\OneWire\Asset" Type="String">Str</Field> <Field Name="System\AttachedDevice\USB\Count" Type="Integer">0</Field> <Field Name="System\AttachedDevice\USB\Name" Type="Integer">0</Field> <Field Name="System\Camera\Enabled" Type="Boolean">true</Field> <Field Name="System\Camera\Present" Type="Boolean">true</Field> <Field Name="Network\BlueTooth\RadioStatus" Type="String">Str</Field></Group></Subsystem>\[/code\]desired output:\[code\]<Subsystem Name="Device Monitor"><Group Name="ITCHealth"> <Group Name="System"> <Group Name="AttachedDevice"> <Group Name="OneWire"> <Field Name="Count" Type="Integer">0</Field> <Field Name="Asset" Type="String">Str</Field> </Group> <Group Name="USB "> <Field Name="Count" Type="Integer">0</Field> <Field Name="Name" Type="Integer">0</Field> </Group> </Group> <Group Name="Camera"> <Field Name="Enabled" Type="Boolean">true</Field> <Field Name="Present" Type="Boolean">true</Field> </Group> </Group> <Group Name="Network"> <Group Name="Bluetooth"> <Field Name="Radiostatus" Type="String">Str</Field> </Group> </Group></Group></Subsystem>\[/code\]I prefer a CSharp solution.Thanks for your help
 
Back
Top