XML ကို ဘယ်လို သုံးနိုင်မလဲ။
XML ကို ဝဘ်ဖွံ့ဖြိုးတိုးတက်မှု၏ ကဏ္ဍများစွာတွင် အသုံးပြုသည်။
XML ကို တင်ဆက်မှုမှ ဒေတာခွဲထုတ်ရန် မကြာခဏ အသုံးပြုသည်။
XML သည် Presentation မှ Data များကို ခွဲခြားသည်။
XML သည် မည်သို့ပြသရမည်နှင့်ပတ်သက်သည့် အချက်အလက်များကို မသယ်ဆောင်ပါ။
တူညီသော XML ဒေတာကို မတူညီသော တင်ပြမှုအခြေအနေများစွာတွင် အသုံးပြုနိုင်သည်။
ထို့အတွက်ကြောင့် XML ဖြင့် Data နှင့် Presentation အကြား အပြည့်အဝ ခြားနားမှု ရှိပါသည်။
XML သည် မကြာခဏ HTML ၏ ဖြည့်စွက်စာဖြစ်သည်။
HTML အပလီကေးရှင်းများစွာတွင် XML ကို ဒေတာကို သိမ်းဆည်းရန် သို့မဟုတ် ပို့ဆောင်ရန် အသုံးပြုသော်လည်း HTML ကို ဖော်မတ်ဖော်မတ်ရန်နှင့် တူညီသောဒေတာကိုပြသရန် အသုံးပြုသည်။
XML သည် ဒေတာကို HTML မှ ခွဲခြားသည်။
ဒေတာကို HTML တွင်ပြသသည့်အခါ၊ ဒေတာပြောင်းလဲသည့်အခါ HTML ဖိုင်ကို တည်းဖြတ်ရန် မလိုအပ်ပါ။
XML ဖြင့် ဒေတာကို သီးခြား XML ဖိုင်များတွင် သိမ်းဆည်းနိုင်ပါသည်။
JavaScript ကုဒ်လိုင်းအနည်းငယ်ဖြင့်၊ သင်သည် XML ဖိုင်ကိုဖတ်နိုင်ပြီး မည်သည့် HTML စာမျက်နှာ၏ ဒေတာအကြောင်းအရာကိုမဆို အပ်ဒိတ်လုပ်နိုင်ပါသည်။
Books.xml
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book
category="cooking">
<title lang="en">Everyday
Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry
Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">XQuery
Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan
Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="web"
cover="paperback">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
ဤသင်ခန်းစာ၏ DOM ကဏ္ဍတွင် XML နှင့် JavaScript ကိုအသုံးပြုခြင်းအကြောင်း သင်ပိုမိုလေ့လာနိုင်မည်ဖြစ်ပါသည်။
ငွေပေးငွေယူဒေတာ
နေ့စဥ်ဒေတာလွှဲပြောင်းမှုများကိုဖော်ပြရန် အမျိုးမျိုးသောစက်မှုလုပ်ငန်းအများအပြားတွင် XML ဖော်မတ်ထောင်ပေါင်းများစွာ တည်ရှိသည်-
- စတော့ရှယ်ယာများနှင့် ရှယ်ယာများ
- ငွေကြေးကိစ္စများ
- ဆေးအချက်အလက်
- သင်္ချာအချက်အလက်
- သိပ္ပံနည်းကျ တိုင်းတာမှုများ
- သတင်းအချက်အလက်များ
- မိုးလေဝသဝန်ဆောင်မှုများ
ဥပမာ- XML သတင်း
XMLNews သည် သတင်းနှင့် အခြားအချက်အလက်များဖလှယ်ခြင်းအတွက် သတ်မှတ်ချက်တစ်ခုဖြစ်သည်။
စံနှုန်းတစ်ခုအသုံးပြုခြင်းသည် သတင်းထုတ်လုပ်သူများနှင့် သတင်းသုံးစွဲသူများအတွက် မတူညီသော ဟာ့ဒ်ဝဲ၊ ဆော့ဖ်ဝဲလ်နှင့် ပရိုဂရမ်းမင်းဘာသာစကားများတစ်လျှောက် သတင်းအချက်အလက်များ ထုတ်လုပ်ခြင်း၊ လက်ခံခြင်းနှင့် သိမ်းဆည်းခြင်းတို့ကို ပိုမိုလွယ်ကူစေသည်။
ဥပမာ XMLNews စာတမ်း။
<?xml version="1.0" encoding="UTF-8"?>
<nitf>
<head>
<title>Colombia Earthquake</title>
</head>
<body>
<headline>
<hl1>143 Dead in Colombia Earthquake</hl1>
</headline>
<byline>
<bytag>By Jared Kotler, Associated Press Writer</bytag>
</byline>
<dateline>
<location>Bogota, Colombia</location>
<date>Monday January 25 1999 7:28 ET</date>
</dateline>
</body>
</nitf>
ဥပမာ- XML မိုးလေဝသဝန်ဆောင်မှု
NOAA (National Oceanic and Atmospheric Administration) မှ XML အမျိုးသား မိုးလေဝသဝန်ဆောင်မှု-
<?xml version="1.0" encoding="UTF-8"?>
<current_observation>
<credit>NOAA's National Weather Service</credit>
<credit_URL>http://weather.gov/</credit_URL>
<image>
<url>http://weather.gov/images/xml_logo.gif</url>
<title>NOAA's National Weather Service</title>
<link>http://weather.gov</link>
</image>
<location>New York/John F. Kennedy Intl Airport, NY</location>
<station_id>KJFK</station_id>
<latitude>40.66</latitude>
<longitude>-73.78</longitude>
<observation_time_rfc822>Mon, 11 Feb 2008 06:51:00 -0500 EST
</observation_time_rfc822>
<weather>A Few Clouds</weather>
<temp_f>11</temp_f>
<temp_c>-12</temp_c>
<relative_humidity>36</relative_humidity>
<wind_dir>West</wind_dir>
<wind_degrees>280</wind_degrees>
<wind_mph>18.4</wind_mph>
<wind_gust_mph>29</wind_gust_mph>
<pressure_mb>1023.6</pressure_mb>
<pressure_in>30.23</pressure_in>
<dewpoint_f>-11</dewpoint_f>
<dewpoint_c>-24</dewpoint_c>
<windchill_f>-7</windchill_f>
<windchill_c>-22</windchill_c>
<visibility_mi>10.00</visibility_mi>
<icon_url_base>http://weather.gov/weather/images/fcicons/</icon_url_base>
<icon_url_name>nfew.jpg</icon_url_name>
<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
</current_observation>