Beruflich Dokumente
Kultur Dokumente
Praktikum
1. Apa Fungsi Validasi
Jawab :
Fungsi Validasi yaitu memvalidasi / mencocokan Syntak XML yang kita buat
sesuai dengan Syntak yang telah kita buat di DTD. Seperti element, atribut,
dll.
Tanpa DTD
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
<!DOCTYPE note[
<!ELEMENT note (to,from,heading)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
<!DOCTYPE note[
<!ELEMENT note (to,from,heading, body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
<weatherReport>
<date>05/29/2002</date>
<location>
<city>Phi</city>, terdapat ‘koma’ <state>PA</state>
<country>USA</country>
</location>
<temperature-range>
<high scale="F">84</high>
<low scale="F">84</low>
</temperature-range>
</weatherReport>
Jawab :
Menghilangkan ‘koma’ dan DTD
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE weatherReport[
<!ELEMENT weatherReport (date,location,temperature-range)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT location (city+,state+,country+)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT temperature-range (high+,low+)>
<!ELEMENT high (#PCDATA)>
<!ELEMENT low (#PCDATA)>
<!ATTLIST high scale CDATA #REQUIRED>
<!ATTLIST low scale CDATA #REQUIRED>
]>
<weatherReport>
<date>05/29/2002</date>
<location>
<city>Phi</city>
<state>PA</state>
<country>USA</country>
</location>
<temperature-range>
<high scale="F">84</high>
<low scale="F">84</low>
</temperature-range>
</weatherReport>
5. Tugas
Membuat XML dan DTD mengenai MatKul apa saja yang diambil di
semester ini
Jawab :
1. XML nya
<Matkul id="2">
<No>2</No>
<Kode>NINF6017</Kode>
<MataKuliah>Sistem Operasi</MataKuliah>
<Sks>3</Sks>
<Js>3</Js>
<Off>12HC</Off>
<Kls>B</Kls>
<Dosen>Agusta Rakhmat Taufani</Dosen>
</Matkul>
<Matkul id="3">
<No>3</No>
<Kode>NINF6018</Kode>
<MataKuliah>Teori Bahasa dan Otomata</MataKuliah>
<Sks>3</Sks>
<Js>3</Js>
<Off>12HD</Off>
<Kls>B</Kls>
<Dosen>Kartika Candra Kirana</Dosen>
</Matkul>
<Matkul id="4">
<No>4</No>
<Kode>NINF6019</Kode>
<MataKuliah>Pemrograman Berorientasi
Object</MataKuliah>
<Sks>3</Sks>
<Js>3</Js>
<Off>12HE</Off>
<Kls>B</Kls>
<Dosen>Kartika Candra Kirana</Dosen>
</Matkul>
<Matkul id="5">
<No>5</No>
<Kode>NINF6020</Kode>
<MataKuliah>Basis Data II</MataKuliah>
<Sks>3</Sks>
<Js>3</Js>
<Off>12HF</Off>
<Kls>B</Kls>
<Dosen>Muhammad Nurwiseso Wibisono</Dosen>
</Matkul>
<Matkul id="6">
<No>6</No>
<Kode>NINF6021</Kode>
<MataKuliah>Kalkulus Lanjut</MataKuliah>
<Sks>3</Sks>
<Js>3</Js>
<Off>12HB</Off>
<Kls>B</Kls>
<Dosen>Irawan Dwi Wahyono</Dosen>
</Matkul>
<Matkul id="7">
<No>7</No>
<Kode>UNIV60009</Kode>
<MataKuliah>Pendidikan Bahasa Indonesia</MataKuliah>
<Sks>2</Sks>
<Js>2</Js>
<Off>E2</Off>
<Kls>E2</Kls>
<Dosen>Aptia</Dosen>
</Matkul>
</myKrs>