XML ကျူတိုရီရယ်

XML ပင်မစာမျက်နှာ XML နိဒါန်း XML အသုံးပြုပုံ XML သစ်ပင် XML Syntax XML ဒြပ်စင်များ XML အရည်အချင်းများ XML Namespaces XML မျက်နှာပြင် XML Http တောင်းဆိုချက် XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLink XML စစ်ဆေးခြင်း XML DTD XML Schema XML ဆာဗာ XML နမူနာများ XML Quiz XML လက်မှတ်

XML AJAX

AJAX နိဒါန်း AJAX XMLHttp AJAX တောင်းဆိုချက် AJAX တုံ့ပြန်မှု AJAX XML ဖိုင် AJAX PHP AJAX ASP AJAX ဒေတာဘေ့စ် AJAX အပလီကေးရှင်းများ AJAX ဥပမာများ

XML DOM

DOM နိဒါန်း DOM Nodes DOM အသုံးပြုခြင်း DOM Node အချက်အလက် DOM Node စာရင်း DOM လမ်းလျှောက်ခြင်း။ DOM လမ်းကြောင်းပြခြင်း။ DOM တန်ဖိုးများရယူပါ။ DOM Change Nodes DOM သည် Nodes များကို ဖယ်ရှားပါ။ DOM သည် Nodes များကို အစားထိုးပါ။ DOM သည် Nodes ကိုဖန်တီးပါ။ DOM Add Nodes DOM Clone Nodes DOM ဥပမာများ

XPath ကျူတိုရီရယ်

XPath နိဒါန်း XPath Nodes XPath Syntax XPath Axes XPath အော်ပရေတာများ XPath ဥပမာများ

XSLT ကျူတိုရီရယ်

XSLT မိတ်ဆက် XSL ဘာသာစကားများ XSLT အသွင်ပြောင်း XSLT < template> XSLT <value-of> XSLT <for-every> XSLT <sort> XSLT <if> XSLT <choose> XSLT လျှောက်ထားပါ။ Client တွင် XSLT ဆာဗာပေါ်ရှိ XSLT XSLT တည်းဖြတ် XML XSLT နမူနာများ

XQuery ကျူတိုရီရယ်

XQuery နိဒါန်း XQuery ဥပမာ XQuery FLWOR XQuery HTML XQuery စည်းမျဥ်းများ XQuery Syntax XQuery Add XQuery ကို ရွေးပါ။ XQuery လုပ်ဆောင်ချက်များ

XML DTD

DTD နိဒါန်း DTD ဆောက်လုပ်ရေးလုပ်ကွက်များ DTD ဒြပ်စင်များ DTD အရည်အချင်းများ DTD ဒြပ်စင်များနှင့် Attr DTD အဖွဲ့အစည်းများ DTD ဥပမာများ

XSD Schema

XSD မိတ်ဆက် XSD လုပ်နည်း XSD <schema> XSD ဒြပ်စင်များ XSD ရည်ညွှန်းချက်များ XSD ကန့်သတ်ချက်များ

XSD Complex

XSD ဒြပ်စင်များ XSD ဗလာ XSD ဒြပ်စင်များသာ XSD စာသားသီးသန့် XSD ရောနှောထားသည်။ XSD အညွှန်းကိန်းများ XSD <any> XSD <anyAttribute> XSD အစားထိုးခြင်း။ XSD ဥပမာ

XSD ဒေတာ

XSD ကြိုး XSD ရက်စွဲ XSD ဂဏန်း XSD ထွေ XSD အကိုးအကား

ဝဘ် ဝန်ဆောင်မှုများ

XML ဝန်ဆောင်မှုများ XML WSDL XML ဆပ်ပြာ XML RDF XML RSS

ကိုးကား

DOM Node အမျိုးအစားများ DOM Node DOM NodeList DOM အမည်ရှိNodeMap DOM စာရွက်စာတမ်း DOM ဒြပ်စင် DOM ရည်ညွှန်းချက် DOM စာသား DOM CDATA DOM မှတ်ချက် DOM XMLHttp တောင်းဆိုချက် DOM Parser XSLT ဒြပ်စင်များ XSLT/XPath လုပ်ဆောင်ချက်များ

XML DOM နှိုင်းယှဉ်DocumentPosition() နည်းလမ်း


❮ Node Object

ဥပမာ

အောက်ပါကုဒ်အပိုင်းအစသည် " books.xml " ကို xmlDoc တွင်တင်ပြီး DOM အထက်တန်းအဆင့်ရှိ node နှစ်ခု (ပထမနှင့် တတိယ <book> ဒြပ်စင်) ၏နေရာချထားမှုကို နှိုင်းယှဉ်သည်-

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
   if (this.readyState == 4 && this.status == 200) {
       myFunction(this);
   }
};
xhttp.open("GET", "books.xml", true);
xhttp.send();

function myFunction(xml) {
    var xmlDoc = xml.responseXML;
    var x = xmlDoc.getElementsByTagName('book')[0];
    var y = xmlDoc.getElementsByTagName('book')[2];
    document.getElementById("demo").innerHTML =
    x.compareDocumentPosition(y);
}

အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-

4

ဘရောက်ဆာအများစုသည် အလွတ်အဖြူကွက်များ သို့မဟုတ် စာကြောင်းအသစ်များကို စာသား node များအဖြစ် သဘောထားကာ IE 9 နှင့် အစောပိုင်းတွင် လုပ်ဆောင်မည်မဟုတ်ပါ။ အထက်ဖော်ပြပါ ဥပမာတွင်၊ ဘရောက်ဆာအများစုသည် 4 ထွက်မည်ဖြစ်ပြီး IE 9 နှင့် အစောပိုင်းတွင် 2 ထွက်မည်ဖြစ်သည်။


အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

နှိုင်းယှဉ်DocumentPosition() နည်းလမ်းသည် DOM အထက်တန်းအဆင့် (စာရွက်စာတမ်း) ရှိ node နှစ်ခု၏ နေရာချထားမှုကို နှိုင်းယှဉ်သည်။


Browser ပံ့ပိုးမှု

Internet Explorer Firefox အော်ပရာ Google Chrome ဆာဖာရီ

နှိုင်းယှဉ်DocumentPosition() နည်းလမ်းကို အဓိက ဘရောက်ဆာအားလုံးတွင် ပံ့ပိုးထားသည်။

မှတ်ချက်- Internet Explorer 9 နှင့် အထက်တွင် ဤနည်းလမ်းကို မပံ့ပိုးပါ။


အထားအသို

nodeObject.compareDocumentPosition(node)

ကန့်သတ်ချက်များ

Parameter Type Description
node Node object Required. Specifies the node to compare with the current node

တန်ဖိုးကို ပြန်ပေးသည်။

Type Description
Number A Number representing where the two nodes are positioned compared to each other. The possible return values are:

1 - No relationship, the two nodes do not belong to the same document.

2 - The specified node precedes the current node.

4 - The specified node follows the current node.

8 - The specified node contains the current node.

16 - The specified node is contained by the current node.

32 - The specified and the current node have no common container node or the two nodes are different attributes of the same node.

Note: The return value could also be a combination of values. E.g. a return value of 20 means that the specified node is contained by the current node (16) AND the specified node follows the current node (4).

နည်းပညာဆိုင်ရာအသေးစိတ်

DOM ဗားရှင်း Core Level 3 Node Object

❮ Node Object