// 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.constillegalCharacters='<em>The Amazing Adventures of Kavalier & Clay</em>';constcdata=XmlService.createCdata(illegalCharacters);consttext=XmlService.createText(illegalCharacters);constroot=XmlService.createElement('root').addContent(cdata).addContent(text);constdocument=XmlService.createDocument(root);constxml=XmlService.getPrettyFormat().format(document);Logger.log(xml);
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-22。"],[[["`Cdata` represents an XML `CDATASection` node, allowing you to store special characters like '\u003c', '\u003e', and '&' literally without escaping them."],["It provides methods to manipulate the CDATA content, such as appending text, detaching from the parent element, and retrieving or setting the text value."],["You can create a `Cdata` node using `XmlService.createCdata(text)` and incorporate it into your XML document."],["`Cdata` is particularly useful when dealing with data that contains characters that would otherwise be interpreted as XML markup."],["It offers flexibility in managing the CDATA content within the XML structure through various methods like `append`, `detach`, `getText`, `getValue`, and `setText`."]]],[]]