Boqonnaa 4 Teeknooloojii Odeeffannoo kutaa 12
Well-formed XML: the rules it never bends
daqiiqaa 4 · Gaaffii qormaata darbe 2 hojjetaman
Kutaalee barnootaa
Barnoota achii jalqabee taphachiisuuf kutaa tokko tuqi.
Barnoota viidiyoo Temari daqiiqaa 4 boqonnaa 4 Teeknooloojii Odeeffannoo kutaa 12: Well-formed XML: the rules it never bends. Barnoonni kun Afaan Ingiliziitiin.
Dabalata boqonnaa 4
Fuulli boqonnaa kanaa wanta Temari boqonnaa kana irratti qabu kan hafe qaba, fakkeenyaaf yaadannoo gabaabaa fi gaaffii shaakalaa deebii isaanii waliin.
Fuula boqonnaa 4 baniWanta barnoonni jedhu hunda
Jechoota barnootaa kutaa kutaan. Barnoota achii jalqabee taphachiisuuf yeroo tuqi.
0:00Introduction
XML looks a lot like HTML. Both use tags in angle brackets. But HTML ignores small errors, and XML allows none. So learn its strict rules.
0:15What XML is for
First, what is XML? Extensible Markup Language. HTML is made to display data. XML is made to store data and carry it between systems.
HTML tags are already defined, like body and title. In XML, you define your own, like book and author. And every XML document has one root element, the parent of all the others. Here, people is the root.
0:45Rules 1 and 2
Now the rules. Rule one: XML is case sensitive. Name with a small n and Name with a capital N are two different tags. So the end tag must match the start tag exactly, letter for letter.
Rule two: elements must be nested properly. They must not overlap. The tag you opened last, you close first. Open Student, open Name inside it. Then close Name, and only then close Student.
1:17Rules 3 and 4
Rule three: attribute values are always quoted. An attribute adds information to an element, as a name and a value. Single or double quotes both work, but never no quotes at all. In HTML, quotes are not required.
Rule four: XML keeps every space you type. HTML squeezes many spaces into one.
1:45Practice question 1Qormaata darbe
Here is a practice question. Which of the following correctly highlights a key difference between XML and HTML? Pause the video, and try it.
Check each option against the rules. XML is case sensitive and keeps every space. HTML ignores case and squeezes spaces into one. The answer is A. B swaps the quote rule: it is XML that needs quotes. C swaps the tags: XML lets you invent tags. And D swaps the errors: HTML ignores small errors, XML allows none.
2:31Rule 5: special characters
Rule five catches many students. Inside XML text, a less than sign means a new tag is starting. So a message like, if salary is less than one thousand, causes an error. The parser, the program that reads the XML, thinks a tag has begun.
Instead, you write an entity reference. For less than, write ampersand, L T, semicolon. For the ampersand itself, write ampersand, A M P, semicolon. Only two characters are strictly illegal in XML text: the less than sign and the ampersand. The greater than sign is legal, but it is a good habit to replace it too.
3:16Practice question 2Qormaata darbe
Try this one. Which two characters are strictly illegal inside XML text data, and must be replaced by entity references to avoid parser errors? Pause, and try it.
The less than sign starts a tag, and the ampersand starts an entity reference. Those are the two. The answer is A. B has the greater than sign, which is legal. C and D are not illegal in text.
3:52Summary
So remember. XML stores data in your own tags, inside one root. It is case sensitive, nested properly, and its attribute values are quoted. Write the less than sign and the ampersand as entity references. Keep practising questions like these on Temari.et.
Boqonnaa kana appii keessatti shaakali
Temari boqonnaa kana gara shaakala yeroon daangeffametti jijjiira; utuu hojjettuu ni sirreessa; wanti si hin galinis barsiisaa AI tiin ni ibsama.
Bilisaan jalqabiTemari.et appii Android qaba; Google Play irratti bilisaan argama.

