XML DOM - CDATASection Object
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
အောက်ပါဥပမာများသည် XML ဖိုင် books.xml ကို အသုံးပြုသည် ။
CDATASection အရာဝတ္ထု
CDATASection အရာဝတ္ထုသည် စာရွက်စာတမ်းတစ်ခုရှိ CDATA အပိုင်းကို ကိုယ်စားပြုသည်။
CDATA ကဏ္ဍတွင် ခွဲခြမ်းစိတ်ဖြာသူမှ ခွဲခြမ်းစိတ်ဖြာမည်မဟုတ်သော စာသားပါရှိသည်။ CDATA ကဏ္ဍအတွင်းရှိ တဂ်များကို အမှတ်အသားပြုခြင်းအဖြစ် သဘောထားမည်မဟုတ်ဘဲ အကြောင်းအရာများကို ချဲ့ထွင်မည်မဟုတ်ပါ။ မူလရည်ရွယ်ချက်မှာ ကန့်သတ်ချက်အားလုံးကို လွတ်ကင်းရန် မလိုအပ်ဘဲ XML အပိုင်းအစများကဲ့သို့သော အရာများ အပါအဝင်ဖြစ်သည်။
CDATA ကဏ္ဍတွင် အသိအမှတ်ပြုထားသည့် တစ်ခုတည်းသော အကန့်အသတ်သည် "]]>" - CDATA ကဏ္ဍ၏ အဆုံးကို ညွှန်ပြသည်။ CDATA ကဏ္ဍများကို ခွဲ၍မရပါ။
CDATASection Object Properties
Property | Description |
---|---|
data | Sets or returns the text of this node |
length | Returns the length of the CDATA section |
CDATASection Object Methods
Property | Description |
---|---|
appendData() | Appends data to the node |
deleteData() | Deletes data from the node |
insertData() | Inserts data into the node |
replaceData() | Replaces data in the node |
splitText() | Splits the CDATA node into two nodes |
substringData() | Extracts data from the node |