'How to write a simple XML file
Grandfather (GF) > Father > Children
Grandfather (GF) : has n number of children which denoted as father (F)
Father (F) : Father has n number of Children and also has an attribute father-name
Children : children has attribute child-name
Please correct me, if i'm wrong
<GF>
<father>
<father-name> f1
<child-name> f1c1 </child-name>
<child-name> f1c2 </child-name>
</father-name>
<father-name> f2
<child-name> f2c1 </child-name>
<child-name> f2c2 </child-name>
<child-name> f2c3 </child-name>
</father-name>
<father-name> f3
<child-name> f3c1 </child-name>
</father-name>
<father>
</GF>
Solution 1:[1]
Here is the the correct xml for your description
<GF>
<father fName="f1">
<child child-name="f1c1" />
<child child-name="f1c2" />
</father>
<father fName="f2">
<child child-name="f2c1" />
<child child-name="f2c2" />
<child child-name="f2c3" />
</father>
<father fName="f3">
<child child-name="f3c1" />
</father>
</GF>
Hope it helps
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andrei |
