XPointer အကျိုးဆက်

ကျွန်တော်တို့ သည် XPointer အမိန့် အခြေခံ ပြောင်းလဲမှု ကို လေ့လာရန် အမှတ်စဉ် တစ်ခု ကို လေ့လာပါမည်。

XPointer အကျိုးဆက်

ဤ အခါ ကျွန်တော်တို့ သည် XPointer နှင့် XLink ကို နောက်ဆုံး စာတမ်း၏ အဖွဲ့အစည်း တစ်ခု ကို မှီခြင်း လိုက်လျောမှု ကို ပြုပြောပါမည်。

ကျွန်တော်တို့ ရာဇဝတ္တိ XML ကို လေ့လာမှုများ မှာ စတင်ပြုလုပ်ပါ (အစား ကျွန်တော်တို့ ချိတ်ဆက်သော စာတမ်းကို)

ရာဇဝတ္တိ XML

ရာဇဝတ္တိ XML အမှတ် "dogbreeds.xml" သည် အမျိုးမျိုးသော ခန္တာများ ကို ရွှာပြထားသည့်အတွက်


<dogbreeds>
<dog breed="Rottweiler" id="Rottweiler">
  <picture url="http://dog.com/rottweiler.gif" />
  <history>
  The Rottweiler's ancestors were probably Roman
  drover dogs.....
  </history>
  <temperament>
  Confident, bold, alert and imposing, the Rottweiler
  is a popular choice for its ability to protect....
  </temperament>
</dog>
<dog breed="FCRetriever" id="FCRetriever">
  <picture url="http://dog.com/fcretriever.gif" />
  <history>
  One of the earliest uses of retrieving dogs was to
  help fishermen retrieve fish from the water....
  </history>
  <temperament>
  The flat-coated retriever is a sweet, exuberant,
  ပြောင်းရဲရဲသော ဆန်းစစ် တစ် ယောက် ဖြစ်၍ ကစား နှင့် အထူး အသုံးပြု သည်...
  </temperament>
</dog>
</dogbreeds>

သင်၏ ဘတ်သမိုင်း ကို ကြည့်ရှု ရန် "dogbreeds.xml" ဖိုင်

မှတ်ချက်:အထက်အရာ XML စာတမ်း သည် ချွတ်ဆွတ် ရန် အရာဝတ္တု အမည် id အချက်အလက် အသုံးပြု သည်။

XML ချွတ်ဆွတ် စာတမ်း

ရှည်လျားသော စာတမ်း ကို ချွတ်ဆွတ် ရန် (XLink အသုံးပြု ပါက) XPointer သည် စာတမ်း၏ အချို့ဒေသ ကို ချွတ်ဆွတ် ပြီး ပေးပေးသည်။ ပုံစံ အချို့ ကို ချွတ်ဆွတ် ရန် လိုက်လျှောက် xlink:href အချက်အလက် အပြီးတွင် ကြော်ကြားချက် (#) နှင့် XPointer အစိုင်းအဝိုင်း ကို ထပ်ထည့်ပေးပါ။

အစိုင်းအဝိုင်း:#xpointer(id("Rottweiler")) အရာဝတ္တု အမည် id သည် "Rottweiler" ဖြစ်သော ပြဿနာ ကို ကိုးကွယ် နိုင်သည်。

ထိုမှာ xlink:href အချက်အလက် သည် နဲ့တူညီသည်:xlink:href="http://dog.com/dogbreeds.xml#xpointer(id('Rottweiler'))"

不过,当使用 id 链接到某个元素时,XPointer 允许简写形式。您可以直接使用 id 的值,就像这样:xlink:href="http://dog.com/dogbreeds.xml#Rottweiler"

下面的 XML 文档可引用每条狗的品种信息,均通过 XLink 和 XPointer 来引用:



xlink:href="http://dog.com/dogbreeds.xml#Rottweiler">
  
  Anton is my favorite dog. He has won a lot of.....
  

xlink:href="http://dog.com/dogbreeds.xml#FCRetriever">
  
  Pluto is the sweetest dog on earth......