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 Elements များနှင့် 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 လုပ်ဆောင်ချက်များ

XPath Syntax


XPath သည် XML စာရွက်စာတမ်းရှိ nodes သို့မဟုတ် node-sets များကိုရွေးချယ်ရန် လမ်းကြောင်းဖော်ပြချက်များကို အသုံးပြုသည်။ လမ်းကြောင်း သို့မဟုတ် အဆင့်များကို လိုက်နာခြင်းဖြင့် node အား ရွေးချယ်သည်။


XML နမူနာစာရွက်စာတမ်း

အောက်ဖော်ပြပါ နမူနာများတွင် အောက်ပါ XML စာရွက်စာတမ်းကို ကျွန်ုပ်တို့ အသုံးပြုပါမည်။

<?xml version="1.0" encoding="UTF-8"?>

<bookstore>

<book>
  <title lang="en">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="en">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore>

Nodes ကိုရွေးချယ်ခြင်း။

XPath သည် XML စာရွက်စာတမ်းရှိ nodes ကိုရွေးချယ်ရန် လမ်းကြောင်းဖော်ပြချက်များကို အသုံးပြုသည်။ လမ်းကြောင်း သို့မဟုတ် အဆင့်များကို လိုက်နာခြင်းဖြင့် node အား ရွေးချယ်သည်။ အသုံးဝင်ဆုံး path expression များကို အောက်တွင် ဖော်ပြထားပါသည်။

Expression Description
nodename Selects all nodes with the name "nodename"
/ Selects from the root node
// Selects nodes in the document from the current node that match the selection no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes

အောက်ပါဇယားတွင် ကျွန်ုပ်တို့သည် အချို့သောလမ်းကြောင်းအသုံးအနှုန်းများနှင့် အသုံးအနှုန်းများ၏ရလဒ်များကို ဖော်ပြထားပါသည်။

Path Expression Result
bookstore Selects all nodes with the name "bookstore"
/bookstore Selects the root element bookstore

Note: If the path starts with a slash ( / ) it always represents an absolute path to an element!

bookstore/book Selects all book elements that are children of bookstore
//book Selects all book elements no matter where they are in the document
bookstore//book Selects all book elements that are descendant of the bookstore element, no matter where they are under the bookstore element
//@lang Selects all attributes that are named lang


ခန့်မှန်းချက်များ

တိကျသော node သို့မဟုတ် တိကျသောတန်ဖိုးတစ်ခုပါရှိသော node ကိုရှာဖွေရန် Predicates ကိုအသုံးပြုသည်။

ခန့်မှန်းချက်များကို လေးထောင့်ကွင်းစကွက်များတွင် အမြဲထည့်ထားသည်။

အောက်ဖော်ပြပါဇယားတွင် ကျွန်ုပ်တို့သည် အချို့သောလမ်းကြောင်းအသုံးအနှုန်းများနှင့် စကားရပ်များ၏ရလဒ်များကို ဖော်ပြထားပါသည်။

Path Expression Result
/bookstore/book[1] Selects the first book element that is the child of the bookstore element.

Note: In IE 5,6,7,8,9 first node is[0], but according to W3C, it is [1]. To solve this problem in IE, set the SelectionLanguage to XPath:

In JavaScript: xml.setProperty("SelectionLanguage","XPath");
/bookstore/book[last()] Selects the last book element that is the child of the bookstore element
/bookstore/book[last()-1] Selects the last but one book element that is the child of the bookstore element
/bookstore/book[position()<3] Selects the first two book elements that are children of the bookstore element
//title[@lang] Selects all the title elements that have an attribute named lang
//title[@lang='en'] Selects all the title elements that have a "lang" attribute with a value of "en"
/bookstore/book[price>35.00] Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00
/bookstore/book[price>35.00]/title Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00

Unknown Nodes ကို ရွေးချယ်ခြင်း။

အမည်မသိ XML node များကို ရွေးချယ်ရန်အတွက် XPath သင်္ကေတများကို အသုံးပြုနိုင်သည်။

Wildcard Description
* Matches any element node
@* Matches any attribute node
node() Matches any node of any kind

အောက်ပါဇယားတွင် ကျွန်ုပ်တို့သည် အချို့သောလမ်းကြောင်းအသုံးအနှုန်းများနှင့် အသုံးအနှုန်းများ၏ရလဒ်များကို ဖော်ပြထားပါသည်။

Path Expression Result
/bookstore/* Selects all the child element nodes of the bookstore element
//* Selects all elements in the document
//title[@*] Selects all title elements which have at least one attribute of any kind

လမ်းကြောင်းများစွာကို ရွေးချယ်ခြင်း။

အသုံးပြုခြင်းဖြင့် | Operator သည် XPath စကားရပ်တွင် လမ်းကြောင်းများစွာကို သင်ရွေးချယ်နိုင်သည်။

အောက်ပါဇယားတွင် ကျွန်ုပ်တို့သည် အချို့သောလမ်းကြောင်းအသုံးအနှုန်းများနှင့် အသုံးအနှုန်းများ၏ရလဒ်များကို ဖော်ပြထားပါသည်။

Path Expression Result
//book/title | //book/price Selects all the title AND price elements of all book elements
//title | //price Selects all the title AND price elements in the document
/bookstore/book/title | //price Selects all the title elements of the book element of the bookstore element AND all the price elements in the document