XML DOM - Die CDATASection Object
Probeer dit self - voorbeelde
Die voorbeelde hieronder gebruik die XML-lêer books.xml .
Die CDATASection voorwerp
Die CDATASection-objek verteenwoordig 'n CDATA-afdeling in 'n dokument.
'n CDATA-afdeling bevat teks wat NIE deur 'n ontleder ontleed sal word nie. Merkers binne 'n CDATA-afdeling sal NIE as opmaak hanteer word nie en entiteite sal nie uitgebrei word nie. Die primêre doel is om materiaal soos XML-fragmente in te sluit, sonder om al die afbakenings te ontsnap.
Die enigste skeidingsteken wat in 'n CDATA-afdeling herken word, is "]]>" - wat die einde van die CDATA-afdeling aandui. CDATA-afdelings kan nie geneste word nie.
CDATASection Object Properties
Property | Description |
---|---|
data | Sets or returns the text of this node |
length | Returns the length of the CDATA section |
CDATASection Object Metodes
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 |