Bwanji osatsegula "Mauthenga" mu Odnoklassniki

Maonekedwe a XML apangidwa kuti asungire deta zomwe zingakhale zothandiza pantchito ya mapulogalamu ena, mawebusaiti, ndi chithandizo cha zinenero zina zolemba. Kupanga ndi kutsegula fayilo ndi mtundu uwu sikovuta. Izi zikhoza kuchitidwa ngakhale ngati palibe mapulogalamu apadera omwe amaikidwa pa kompyuta.

Zambiri za XML

XML yokha ndi chinenero chakulumikiza, mofanana ndi HTML, yomwe imagwiritsidwa ntchito pa masamba. Koma ngati chigwiritsirochi chikugwiritsidwa ntchito powonetsera chidziwitso ndi kuyenerera kwake, ndiye XML imalola kuti ikhale yolembedwa mwanjira inayake, zomwe zimapangitsa chinenero ichi kukhala chofanana ndi malo osungira mawu omwe safuna DBMS.

Mukhoza kulenga mafayilo a XML pogwiritsira ntchito mapulogalamu apadera kapena mkonzi womasuliridwa mu Windows. Mtundu wa mapulogalamu ogwiritsidwa ntchito umatsimikizira kuti ndi bwino kulembera makalata ndi mlingo wa ntchito zake.

Njira 1: Visual Studio

M'malo mwake, mkonzi wa khodi wa Microsoft akhoza kugwiritsa ntchito wina aliyense kuchokera kwa ena opanga. Ndipotu, Visual Studio ndiwopambana kwambiri kuposa nthawi zonse Notepad. Makhalidwewa tsopano ali ndi zochitika zapadera, zolakwitsa zimatsindikitsidwa kapena zakonzedweratu, ndipo zizindikiro zapadera zatumizidwa kale mu pulogalamuyi, zomwe zimakulolani kuti mukhale osavuta kulenga mafayilo akuluakulu a XML.

Kuti muyambe, muyenera kupanga fayilo. Dinani pa chinthu "Foni" m'bokosi lapamwamba komanso kuchokera kumenyu yotsitsa "Pangani ...". Mndandanda umayamba ndi chinthucho "Foni".

  • Mudzasamutsidwa kuwindo ndi kusankha fayilo yowonjezera, sankhani chinthucho. "Fayilo ya XML".
  • Fayilo yatsopanoyo idzakhala yoyamba ndi encoding ndi version. Mavesi oyambirira ndi encoding amalembedwa ndi chosasintha. UTF-8zomwe mungasinthe nthawi iliyonse. Pambuyo popanga fayilo ya XML yochuluka, muyenera kulemba zonse zomwe zinali mu malangizo apitawo.

    Pamapeto pake, sankhani gulu lapamwamba. "Foni", ndi pomwepo kuchokera kumtundu wotsika katundu "Sungani Zonse".

    Njira 2: Microsoft Excel

    Mukhoza kupanga fayilo ya XML popanda kulemba code, mwachitsanzo, pogwiritsa ntchito mabaibulo amakono a Microsoft Excel, omwe amakulolani kusunga matebulo ndizowonjezereka. Komabe, muyenera kumvetsetsa kuti pakadali pano simungapange chinachake chogwira ntchito kuposa tebulo nthawi zonse.

    Njira iyi ndi yabwino kwa iwo omwe safuna kapena sakudziwa momwe angagwiritsire ntchito ndi code. Komabe, pakadali pano, wosuta angakumane ndi mavuto ena pamene akulemba fayilo mu fomu ya XML. Mwamwayi, mukhoza kugwira ntchito yosintha tebulo nthawi zonse ku XML pokhapokha pa MS Excel. Kuti muchite izi, gwiritsani ntchito malangizo awa:

    1. Lembani tebulo ndi zilizonse.
    2. Dinani batani "Foni"kuti mndandanda wam'mwamba.
    3. Zenera lapaderalo lidzatsegulidwa kumene mukuyenera kudina "Sungani Monga ...". Chinthuchi chingapezeke kumanzere akumanzere.
    4. Tchulani foda kumene mukufuna kusunga fayilo. Fodayi imasonyezedwa pakati pa chinsalu.
    5. Tsopano mukuyenera kufotokoza dzina la fayilo, ndipo mu gawoli "Fayilo Fayilo" sankhani kuchokera kumenyu yotsitsa
      "Deta ya XML".
    6. Dinani batani Sungani ".

    Njira 3: Notepad

    Ngakhalenso yachizolowezi ndi bwino kugwira ntchito ndi XML. NotepadKomabe, wosuta yemwe sakudziwa chilankhulidwe cha chinenerocho ayenera kukhala kovuta, popeza nkofunika kupereka malamulo ndi malemba osiyanasiyana mmenemo. Ntchitoyi idzakhala yophweka komanso yopindulitsa kwambiri mu mapulogalamu apadera a code yokonzera, mwachitsanzo, mu Microsoft Visual Studio. Ali ndi chizindikiro chapadera ndi zida zothandizira, zomwe zimapangitsa kuti ntchito ya munthu yemwe sadziwa bwino chilankhulochi ndi yosavuta.

    Njira iyi sichiyenera kutsegula chilichonse, chifukwa idakhazikitsidwa kale m'dongosolo la opaleshoni. Notepad. Tiyeni tiyesere kupanga tebulo losavuta la XML molingana ndi malangizo awa:

    1. Pangani chikalata chowonekera chowonjezera Txt. Mutha kuzilemba paliponse. Tsegulani.
    2. Yambani kulemba malamulo oyambirira mmenemo. Choyamba muyenera kuyika fayilo yonse yakukhomba ndikufotokozera XML version, izi zikuchitidwa ndi lamulo lotsatira:

      Mtengo woyamba ndiwongolera, sikofunikira kusintha, ndipo mtengo wachiwiri ndi encoding. Ndi bwino kugwiritsa ntchito encoding. UTF-8, monga mapulogalamu ambiri ndi othandizira amagwira ntchito molondola. Komabe, zingasinthidwe kukhala wina aliyense, pokhapokha polemba dzina lofunika.

    3. Pangani cholemba choyamba mu fayilo yanu mwa kulemba chizindikirondi kutseka izo mwanjira imeneyo.
    4. M'kati mwa chikho ichi mukhoza kulemba zina. Pangani chizindikirondi kumupatsa dzina lililonse, mwachitsanzo, "Ivan Ivanov." Nyumba yomaliza iyenera kukhala monga iyi:

    5. Chizindikiro cha mkatiTsopano ndizotheka kulembetsa magawo ambiri, mu nkhaniyi ndizolemba za Ivan Ivanov. Tiyeni tiwerenge msinkhu wake ndi udindo wake. Zidzawoneka ngati izi:

      25
      Zoona

    6. Ngati mutatsatira malangizo, muyenera kupeza code yomweyi pansipa. Pambuyo pomaliza ntchitoyi pamndandanda wapamwamba, pezani "Foni" ndi kuchokera ku menyu yotsitsa "Sungani Monga ...". Mukamasunga kumunda "Firimu" pambuyo pa dontho pamenepo payenera kukhala chongowonjezera osati Txtndi XML.

    Chinachake chonga ichi chiyenera kuoneka ngati zotsatira zomaliza:





    25
    Zoona

    XML-compilers amayenera kukonza ndondomeko iyi mu mawonekedwe a tebulo ndi mzere umodzi, kumene deta yokhudza Ivan Ivanov inawonetsedwa.

    Mu Notepad N'zotheka kupanga matebulo ophweka monga chonchi, koma kulenga zambiri zolemba deta kungayambitse mavuto, chifukwa mwachizoloƔezi Notepad Palibe zolakwika kukonza ntchito mu code kapena kuwonekera kwawo.

    Monga mukuonera, kulenga fayilo ya XML palibe chovuta. Ngati mukufuna, aliyense wogwiritsa ntchito pa kompyuta akhoza kuzilenga. Komabe, kuti mupange fayilo ya XML yodalirika, ndi bwino kuti tiphunzire chinenero chamakonochi, pamsinkhu woyambirira.