The Pragmatic Programmer

Tulisan iseng kalo ada waktu.
See also: Other Geeks@INDC

Tantangan Pemrograman - 3

Coba buat aplikasi browser sederhana yang menerima input file xml dan merender elemen-elemennya ke layar.

Contoh file xml-nya:

<?xml version="1.0" encoding="utf-8"?>
<screen id="1" name="index" backgound_image="background.png" color="#3300FF" font_family="Tahoma" font_size="10pt" persistent="False" specialchars="€Çàáãäåæçèéêëíîïñòóõöøñùúüÿ" title="IENS">
<body>
<item id="1" sortorder="10">
<grid id="1" rows="3" cols="3">
<griditems>
<item sortorder="10">
<a id="3" href="http://dynamic.steape.com/iensdatahandler.asx?action=closestrestaurants" target="self" addmyposition="True" imgsrc="closest.png" textposition="bottom">Closest Restaurants</a>
</item>
<item sortorder="20">
<a id="4" href="http://www.google.com" target="new" imgsrc="google.png" textposition="bottom">Go to Google</a>
</item>
<item sortorder="30">
<a id="5" href="http://dynamic.steape.com/iensdatahandler.asx?action=closestrestaurants" target="self" imgsrc="faves.png" textposition="bottom">My Favourites</a>
</item>
<item sortorder="40">
<a id="6" href="othercities.xml" target="self" addmyposition="False" imgsrc="cities.png" textposition="bottom">Other Cities</a>
</item>
</griditems>
</grid>
</item>
</body>
</screen>

Hasil yang diinginkan:


Share this post: | | | |

Comments

cahnom said:

Hayyah ini kan bisa dilakukan dengan XSLT. Gak seru ah...

# February 21, 2009 12:26 AM

irwansyah said:

Emang bisa Kur, tapi ini tujuannya untuk melatih skill bukan untuk ngerjain project.

# February 21, 2009 1:22 AM