Home » Community » Newbie corner » XML exercise
XML exercise [message #35990] |
Mon, 16 April 2012 20:49 |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
Good evening guys,
I can’t understand how can I correctly use XML. Looking into bazar I haven’t found a examples so I thought about a little “exercise” maybe useful for newbies about Parsing and XmlNode
Here a little example of what I’m planning to create:
This little program have a droplist where users can select different type of cars. For each car, the program show select1, select2 and select3 values.
A possible Xml structure could be:
<car>A</car>
<value>
<Select1 value="1"/>
<Select2 value="2"/>
<Select3 value="3"/>
</value>
<car>B</car>
<value>
<Select1 value="4"/>
<Select2 value="5"/>
<Select3 value="6"/>
</value>
So, Selecting “A” from the DropList menu the program will show
Select1 = 1,
Select2 = 2,
Select3 =3,
and selecting “B”
Select1 = 4,
Select2 = 5,
Select3 = 6.
-The first step will be to code it for reading XLM structure and show stored values.
-Then, the second step will be to allow user adding/deleting cars with their own values.
The AddressBook example in bazar show the possibility to store datas but it creates a new xml everytime, so the problem is a bit different.
Thanks for your support
Regards,
Matteo
here the layout
LAYOUT(prova4Layout, 188, 240)
ITEM(Label, dv___0, SetLabel(t_("Car :")).LeftPosZ(10, 55).TopPosZ(40, 21))
ITEM(Label, dv___1, SetLabel(t_("Select 1 :")).LeftPosZ(10, 55).TopPosZ(108, 21))
ITEM(Label, dv___2, SetLabel(t_("Select 2 :")).LeftPosZ(10, 55).TopPosZ(134, 21))
ITEM(Label, dv___3, SetLabel(t_("Select 3 :")).LeftPosZ(10, 55).TopPosZ(162, 21))
ITEM(DropList, dl, LeftPosZ(72, 103).TopPosZ(41, 19))
ITEM(StaticText, dv___5, SetText(t_("Setting :")).SetFont(StdFontZ(16).Bold()).LeftPosZ(10, 166).TopPosZ(7, 25))
ITEM(StaticText, dv___6, SetText(t_("Details :")).SetFont(StdFontZ(16).Bold()).LeftPosZ(10, 164).TopPosZ(74, 25))
ITEM(EditDouble, select1, LeftPosZ(72, 102).TopPosZ(110, 19))
ITEM(EditDouble, select2, LeftPosZ(72, 102).TopPosZ(136, 19))
ITEM(EditDouble, select3, LeftPosZ(72, 102).TopPosZ(163, 19))
ITEM(Button, dv___10, SetLabel(t_("NEW")).LeftPosZ(7, 77).TopPosZ(200, 23))
ITEM(Button, dv___11, SetLabel(t_("DELETE")).LeftPosZ(93, 79).TopPosZ(200, 23))
END_LAYOUT
-
Attachment: Cattura.JPG
(Size: 19.57KB, Downloaded 465 times)
[Updated on: Wed, 18 April 2012 09:23] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 27 23:51:30 CEST 2024
Total time taken to generate the page: 2.04772 seconds
|