// 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. var illegalCharacters ='<em>The Amazing Adventures of Kavalier & Clay</em>'; var cdata =XmlService.createCdata(illegalCharacters); var text =XmlService.createText(illegalCharacters); var root =XmlService.createElement('root').addContent(cdata).addContent(text); var document =XmlService.createDocument(root); var xml =XmlService.getPrettyFormat().format(document); Logger.log(xml);
Получает текстовое значение всех узлов, которые являются прямыми или косвенными дочерними элементами узла, в том порядке, в котором они появляются в документе.
Получает текстовое значение всех узлов, которые являются прямыми или косвенными дочерними элементами узла, в том порядке, в котором они появляются в документе.
Возвращаться
String — текстовое значение всех узлов, которые являются прямыми или косвенными дочерними элементами узла.
[[["Прост для понимания","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"]],["Последнее обновление: 2025-01-07 UTC."],[[["`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`."]]],["The document describes an XML `CDATASection` node and its methods. Key actions include creating a `CDATASection` with special characters, contrasting it with a `Text` node, and logging the results. Methods allow appending text, detaching from a parent, getting the parent element, retrieving text value, accessing the value of child nodes, and setting text. These functions enable manipulation and retrieval of the `CDATASection` node's content and structure within an XML document.\n"]]