XML CDATASection 节点的表示形式。
// Create and log an XML document that shows how special characters like '<', // '>', and '&' are stored in a CDATASection node as compared to in a Text node. const illegalCharacters = '<em>The Amazing Adventures of Kavalier & Clay</em>'; const cdata = XmlService.createCdata(illegalCharacters); const text = XmlService.createText(illegalCharacters); const root = XmlService.createElement('root').addContent(cdata).addContent(text); const document = XmlService.createDocument(root); const xml = XmlService.getPrettyFormat().format(document); Logger.log(xml);
方法
| 方法 | 返回类型 | 简介 | 
|---|---|---|
| append(text) | Text | 将给定文本附加到节点中已存在的任何内容。 | 
| detach() | Content | 将节点从其父级 Element节点分离。 | 
| get | Element | 获取节点的父 Element节点。 | 
| get | String | 获取 Text节点的文本值。 | 
| get | String | 获取节点的直接或间接子节点的所有文本值,按文档中显示的顺序。 | 
| set | Text | 设置 Text节点的文本值。 | 
详细文档
append(text)
get
获取 Text 节点的文本值。
返回
String - Text 节点的文本值
get
获取节点的直接或间接子节点的所有文本值,按文档中显示的顺序。
返回
String - 节点的直接或间接子节点的所有文本值