Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cdata
Représentation d'un nœud 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.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);
Récupère la valeur textuelle de tous les nœuds qui sont des enfants directs ou indirects du nœud, dans l'ordre dans lequel ils apparaissent dans le document.
Récupère la valeur textuelle de tous les nœuds qui sont des enfants directs ou indirects du nœud, dans l'ordre dans lequel ils apparaissent dans le document.
Renvois
String : valeur textuelle de tous les nœuds qui sont des enfants directs ou indirects du nœud
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/12/22 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2024/12/22 (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"]]