Pangani fayilo ya XML

Pin
Send
Share
Send

Mawonekedwe a XML adapangidwa kuti azisunga deta yomwe ingakhale yothandiza pakugwiritsa ntchito mapulogalamu ena, masamba, ndi kuthandizira m'zilankhulo zina. Kupanga ndi kutsegula fayilo yokhala ndi mawonekedwe awa sikovuta. Izi zitha kuchitika ngakhale palibe mapulogalamu apadera omwe aikidwa pa kompyuta.

Pafupifupi XML

XML palokha ndi chilankhulo chofanizira, chofanana ndi HTML chomwe chimagwiritsidwa ntchito patsamba. Koma ngati chomalizachi chikugwiritsidwa ntchito pongotulutsa chidziwitso ndi njira yake yolondola, ndiye kuti XML imalola kuti idapangidwe mwanjira inayake, zomwe zimapangitsa chilankhulochi kukhala china chofanana ndi analogue ya database yomwe sikutanthauza DBMS.

Mutha kupanga mafayilo a XML mothandizidwa ndi mapulogalamu apadera kapena ndi cholembera mawu chomwe chili mu Windows. Kugwiritsa bwino ntchito kwa kulemba komanso kuchuluka kwa magwiridwe ake zimatengera mtundu wa mapulogalamu omwe amagwiritsidwa ntchito.

Njira 1: Situdiyo yowonera

M'malo mwake, Microsoft wa code code akhoza kugwiritsa ntchito china chilichonse kuchokera kwa opanga ena. M'malo mwake, Zojambula Zojambula ndizambiri zamtundu wanthawi zonse Notepad. Khodi tsopano ili ndi chiwonetsero chapadera, zolakwika zimawunikidwa kapena kukonza okha, ndipo mawonekedwe apadera adatumizidwa kale mu pulogalamu yomwe ingapangitse kuti pakhale kupangika kwama fayilo akuluakulu a XML.

Kuti muyambe, muyenera kupanga fayilo. Dinani pazinthu Fayilo mumtundu wapamwamba komanso kuchokera kumenyu yotsika-pansi "Pangani ...". Mndandanda udzatsegulidwa pomwe mawu awonetsedwa. Fayilo.

  • Mudzasamutsidwa ku zenera ndikusankha fayilo yowonjezera, motero, sankhani "Fayilo ya XML".
  • Fayilo yongopangidwa kumene itakhala kale ndi mzere woyamba ndikusunga ndikusintha. Mtundu woyambirira ndi kusinthanitsa kumalembedwa ndi okhazikika Utf-8zomwe mungasinthe nthawi iliyonse. Komanso, kuti mupange fayilo ya XML yodzaza, muyenera kulemba zonse zomwe zinali m'malangizo apitawa.

    Mukamaliza, sankhani kachiwiri pagawo lapamwamba Fayilo, ndi pomwepo kuchokera pa mndandanda wotsika pansi Sungani Zonse.

    Njira 2: Microsoft Excel

    Mutha kupanga fayilo ya XML popanda kulemba manambala, mwachitsanzo, pogwiritsa ntchito zamakono zamakono za Microsoft Excel, zomwe zimakupatsani mwayi kuti musunge matebulo ndi kuwonjezera. Komabe, muyenera kumvetsetsa kuti pankhaniyi, kupanga china chofunikira kwambiri kuposa tebulo lokhazikika sichitha.

    Njirayi ndi yoyenera kwambiri kwa iwo omwe safuna kapena sangathe kugwira ntchito ndi code. Komabe, pankhaniyi, wogwiritsa ntchitoyo akhoza kukumana ndi mavuto ena akamalemba fayilo mu mtundu wa XML. Tsoka ilo, opareshoni yosinthira tebulo lokhazikika ku XML ndizotheka pokhapokha pazosinthidwa zaposachedwa za MS Excel. Kuti muchite izi, gwiritsani ntchito malangizo atsatanetsatane:

    1. Dzazani tebulo ndi zina zambiri.
    2. Dinani batani Fayilopa mndandanda wapamwamba.
    3. Iwindo lapadera lidzatsegulidwa pomwe muyenera kudina "Sungani Monga ...". Katunduyu amatha kupezeka kumanzere kumanzere.
    4. Fotokozerani foda yomwe mukufuna kusunga fayilo. Chikwatu chikuwonetsedwa pakatikati pazenera.
    5. Tsopano muyenera kufotokozera dzina la fayiloyo, komanso m'gawolo Mtundu wa Fayilo sankhani kuchokera pa menyu otsikira
      Zambiri za XML.
    6. Dinani batani "Sungani".

    Njira 3: Zolemba

    Pogwira ntchito ndi XML, ngakhale nthawi zonse Notepad, komabe, ndizovuta kwa wogwiritsa ntchito chilankhulocho, chifukwa malamulo ndi zilembo zosiyanasiyana ziyenera kulembedwamo. Njirayi ikhale yopepuka komanso yopindulitsa kwambiri mumapulogalamu apadera osintha nambala mwachitsanzo, mu Microsoft Visual Studio. Ali ndi zilembo zapadera komanso zothandiza, zomwe zimapangitsa kuti ntchito ya munthu ikhale yatsopano m'chinenerochi.

    Palibe chifukwa chotsitsira chilichonse mwanjira iyi, popeza chimaphatikizidwa kale ku opareting'i sisitimu Notepad. Tiyeni tiyesere kupanga tebulo losavuta la XML mmenemo malingana ndi malangizo:

    1. Pangani chikalata chomveka bwino chowonjezera Txt. Mutha kuyiyika kulikonse. Tsegulani.
    2. Yambani kulemba magulu oyamba mmenemo. Choyamba muyenera kutanthauzira kukhazikitsa fayilo yonse ndikulongosola mtundu wa XML, izi zimachitika ndi lamulo lotsatira:

      Mtengo woyamba ndi mtundu, sikofunikira kusintha, ndipo mtengo wachiwiri ndi kusinthanitsa. Kulembapo kotsimikizidwa Utf-8, popeza mapulogalamu ambiri ndi othandizira amagwira nawo ntchito molondola. Komabe, zitha kusinthidwa kukhala china chilichonse polemba dzina lomwe mukufuna.

    3. Pangani chikwatu choyamba mufayilo yanu polemba chizindikirondi kutseka motero.
    4. Mkati mwa chizindikiro ichi, mutha kulemba zamtundu wina. Pangani chizindikirondikumupatsa dzina lililonse, mwachitsanzo, "Ivan Ivanov." Zomalizidwa zikhale chonchi:

    5. Mkati wamkatiTsopano mutha kufotokozera zambiri mwatsatanetsatane, pankhani iyi, zambiri za Ivan Ivanov. Tilembe zaka zake ndi udindo. Zikuwoneka motere:

      25
      Zowona

    6. Ngati mumatsatira malangizowo, ndiye kuti muyenera kupeza nambala yomweyo ngati pansipa. Mukamaliza, mumenyu yapamwamba, pezani Fayilo ndi kuchokera menyu otsikira "Sungani Monga ...". Mukusunga kumunda "Fayilo dzina" pambuyo pamfundo payenera kukhala ndi kuwonjezera ayi Txt, ndi XML.

    China chake chikuyenera kuwoneka ngati zotsatira zanu zomaliza:





    25
    Zowona

    Ma compilers a XML amayenera kutsata kachidindo kameneka ngati tebulo lokhala ndi mzati umodzi, womwe umakhala ndi chidziwitso chokhudza Ivan Ivanov.

    Mu Notepad ndikothekanso kupanga matebulo osavuta motere, koma tikapanga njira zambiri zowonjezera zovuta, zovuta zimatha kubuka, chifukwa zabwinobwino Notepad Palibe ntchito zowongolera zolakwika kapena kuziwonetsa.

    Monga mukuwonera, palibe chovuta pakupanga fayilo ya XML. Ngati zingafunike, zitha kupangidwa ndi wogwiritsa ntchito aliyense yemwe amadziwa kwambiri kugwiritsa ntchito kompyuta. Komabe, kuti mupange fayilo ya XML yathunthu, ndikofunikira kuti muphunzire chilankhulochi, osachepera pamlingo woyambira.

    Pin
    Send
    Share
    Send