Ifomethi ye-XML yakhelwe ukugcina idatha engase isebenze emsebenzini wezinhlelo ezithile, amawebusayithi, nokusekelwa kwezilimi ezithile ze-markup. Ukudala nokuvula ifayela ngale fomethi akulula. Lokhu kungenziwa ngisho noma kungekho software ekhethekile efakwe kukhompyutha.
Okuncane mayelana ne-XML
Ngokwalo, i-XML ulimi olumamaki, oluthile olufana ne-HTML, elisetshenziselwa amakhasi ewebhu. Kodwa uma lokhu kusetshenziselwa kuphela ukubonisa ulwazi kanye nekhono layo elifanele, i-XML ivumela ukuthi ihlelwe ngendlela ethile, okwenza lolu limi lufane nese database yolwazi oludinga ukuthi aludingi i-DBMS.
Ungakha amafayela we-XML usebenzisa izinhlelo ezikhethekile noma umhleli wombhalo owakhelwe ku-Windows. Uhlobo lwesofthiwe elisetshenzisiwe lunikeza ukuthi kube khona ikhodi yokubhala kanye nezinga lokusebenza kwalo.
Indlela 1: I-Visual Studio
Esikhundleni salokho, umhleli wekhodi we-Microsoft angasebenzisa noma yikuphi okunye okuvela kwabanye abathuthukisi. Eqinisweni, i-Visual Studio inguqulo ephakeme kakhulu yejwayelekile I-Notepad. Ikhodi manje inokuqokomisa okhethekile, amaphutha agcizelelwe noma aqondiswe ngokuzenzakalelayo, futhi izifanekiso ezikhethekile sezivele zilayishwe ohlelweni, okukuvumela ukuthi wenze lula ukudala amafayela amakhulu we-XML.
Ukuze uqalise, udinga ukwakha ifayela. Chofoza entweni "Ifayela" ku-bar phezulu nakumenyu yokudonsa ukhetha "Dala ...". Uhlu luvuleka ngento "Ifayela".
Kufayela elisha lizobe seliyindlela yokuqala yokufaka ikhodi kanye nencazelo. Inguqulo yokuqala kanye nekhodidi ebhalisiwe ngokuzenzakalelayo. UTF-8ongayishintsha nganoma yisiphi isikhathi. Ngokulandelayo ukwakha ifayela le-XML eligcwele, udinga ukubhalisa konke okusemfundweni yangaphambilini.
Lapho uqedile, khetha iphaneli eliphezulu futhi. "Ifayela", futhi lapho kusuka kokungenayo imenyu yezinto "Gcina konke".
Indlela 2: Microsoft Excel
Ungakha ifayela le-XML ngaphandle kokubhala ikhodi, isibonelo, usebenzisa izinguqulo zanamuhla ze-Microsoft Excel, okuvumela ukuthi ulondoloze amatafula ngalesi sandiso. Kodwa-ke, udinga ukuqonda ukuthi kulokhu awukwazi ukudala okuthile okusebenzayo kunetafula ejwayelekile.
Le ndlela ifaneleka kakhulu kulabo abangafuni noma abazi ukuthi bangasebenza kanjani nekhodi. Noma kunjalo, kulokhu, umsebenzisi angase ahlangane nezinkinga ezithile lapho ebhala ifayela kwifomethi ye-XML. Ngeshwa, ungenza ukusebenza kokuguqula ithebula evamile ku-XML kuphela ezinkampanini zakamuva ze-MS Excel. Ukuze wenze lokhu, sebenzisa le miyalelo elandelayo ngesinyathelo:
- Gcwalisa itafula nganoma yikuphi okuqukethwe.
- Chofoza inkinobho "Ifayela"ukuthi kwimenyu ephezulu.
- Iwindi elikhethekile lizovula lapho udinga ukuchofoza khona "Londoloza njengo ...". Le nto ingatholakala kwimenyu yesokunxele.
- Cacisa ifolda lapho ufuna ukulondoloza ifayela. Ifolda iboniswa phakathi kwesikrini.
- Manje udinga ukucacisa igama lefayela, futhi esigabeni "Uhlobo lwefayela" khetha kusuka kwimenyu yokudonsa
"Idatha ye-XML". - Chofoza inkinobho "Gcina".
Indlela 3: Inothi
Ngisho evamile kulungile ukusebenza ne-XML. I-NotepadKodwa-ke, umsebenzisi ongajwayelene ne-syntax yolimi kuyodingeka kube nzima, ngoba kubalulekile ukunikeza imiyalo ehlukahlukene kanye namathegi kuwo. Le nqubo izoba yinto elula futhi ekhiqiza kakhulu ezinhlelweni ezikhethekile zokuhlela ikhodi, isibonelo, ku-Microsoft Visual Studio. Banekhwalithi ekhethekile yokugqamisa kanye namathuluzi, okuwenza kube lula umsebenzi womuntu ongajwayelene ne-syntax yalolu limi.
Le ndlela ayidingi ukulanda noma yini, ngoba isivele isakhiwe ohlelweni lokusebenza. I-Notepad. Ake sizame ukwenza ithebula elilula le-XML ngokuya kulo myalelo:
- Yakha idokhumenti yombhalo ocacile nesandiso Txt. Ungayithumela noma ikuphi. Vula it.
- Qala ukubhala imiyalo yokuqala kuyo. Okokuqala udinga ukusetha lonke ifayela lokufaka ikhodi bese ucacisa inguqulo ye-XML, lokhu kwenziwa ngomyalo olandelayo:
Inani lokuqala liyi-version, akudingekile ukuliguqula, futhi inani lesibili yi-encoding. Kutuswa ukusebenzisa i-encoding. UTF-8, njengoba izinhlelo eziningi nabasebenzi besebenza kahle. Nokho, kungashintshwa kunoma yimuphi omunye, ngokubhalisa igama elifunayo.
- Dala isiqondisi sokuqala efayeleni lakho ngokubhala ithegi
futhi ukuvala ngaleyo ndlela
.
- Ngaphakathi kwalomaki manje ungabhala okuqukethwe. Dala umaki
futhi umnike igama, isibonelo, "Ivan Ivanov." Isakhiwo esiphelile kufanele sibe kanje:
- Ngaphakathi kwithegi
Manje kungenzeka ukubhalisa imingcele eningiliziwe, kulokhu ulwazi ngolunye u-Ivan Ivanov. Masibhale phansi iminyaka yakhe nesimo sakhe. Kuzobukeka kanje:
25
Iqiniso - Uma ulandela imiyalo, kufanele uthole ikhodi efanayo neyansi ngezansi. Lapho uqedile umsebenzi kwimenyu ephezulu, thola "Ifayela" futhi kusuka kwimenyu yokudonsa ukhetha "Londoloza njengo ...". Uma ulondoloza ensimini "Igama lefayela" ngemuva kwephashazi kufanele kube nesandiso hhayi Txtfuthi I-XML.
Into enjengale kufanele ibonakale njengomphumela ophelile:
25
Iqiniso
Ama-XML-compilers kufanele asebenze le khodi ngendlela yetafula ngekholomu eyodwa, lapho idatha ephathelene ne-Ivan Ivanov ethile iboniswa khona.
Ngaphakathi I-Notepad Kungenzeka ukwenza amatafula alula njengalokhu, kodwa ukudala izigaba eziningi zedatha kungabangela ubunzima, ngoba kujwayelekile I-Notepad Ayikho imisebenzi yokulungiswa kwephutha kukhodi noma ukugqamisa kwabo.
Njengoba ungabona, ukudala ifayela le-XML akuyona into eyinkimbinkimbi. Uma ufisa, noma yimuphi umsebenzisi ongakwazi ukusebenza kangako kukhompyutha angayidala. Noma kunjalo, ukwakha ifayela le-XML eligcwele, kunconywa ukuba ufunde lolu limi lokumaketha, okungenani ezingeni lokuqala.