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 2025/07/26 (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 2025/07/26 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eText\u003c/code\u003e object represents a text node within an XML document and provides methods for manipulating its content.\u003c/p\u003e\n"],["\u003cp\u003eYou can use methods like \u003ccode\u003eappend()\u003c/code\u003e, \u003ccode\u003esetText()\u003c/code\u003e, and \u003ccode\u003egetText()\u003c/code\u003e to modify and retrieve the text content of the node.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edetach()\u003c/code\u003e removes the node from its parent element, while \u003ccode\u003egetParentElement()\u003c/code\u003e allows access to the parent element.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetValue()\u003c/code\u003e retrieves the text value of all child nodes, offering a way to access nested content within the text node.\u003c/p\u003e\n"]]],["The `Text` node represents XML text content. Key actions include: appending text to the node via `append(text)`, detaching the node from its parent using `detach()`, and retrieving the parent element with `getParentElement()`. Text content can be obtained using `getText()` for the node's text or `getValue()` for text of child nodes. Finally, `setText(text)` sets the text value of the node. These methods allow manipulation and reading of text in an XML structure.\n"],null,["Text\n\nA representation of an XML `Text` node. \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [append(text)](#append(String)) | [Text](#) | Appends the given text to any content that already exists in the node. |\n| [detach()](#detach()) | [Content](/apps-script/reference/xml-service/content) | Detaches the node from its parent [Element](/apps-script/reference/xml-service/element) node. |\n| [getParentElement()](#getParentElement()) | [Element](/apps-script/reference/xml-service/element) | Gets the node's parent [Element](/apps-script/reference/xml-service/element) node. |\n| [getText()](#getText()) | `String` | Gets the text value of the `Text` node. |\n| [getValue()](#getValue()) | `String` | Gets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document. |\n| [setText(text)](#setText(String)) | [Text](#) | Sets the text value of the `Text` node. |\n\nDetailed documentation \n\n`append(text)` \nAppends the given text to any content that already exists in the node.\n\nParameters\n\n| Name | Type | Description |\n|--------|----------|--------------------------------|\n| `text` | `String` | the text to append to the node |\n\nReturn\n\n\n[Text](#) --- the `Text` node, for chaining\n\n*** ** * ** ***\n\n`detach()` \nDetaches the node from its parent [Element](/apps-script/reference/xml-service/element) node. If the node does not have a parent,\nthis method has no effect.\n\nReturn\n\n\n[Content](/apps-script/reference/xml-service/content) --- the detached node\n\n*** ** * ** ***\n\n`get``Parent``Element()` \nGets the node's parent [Element](/apps-script/reference/xml-service/element) node. If the node does not have a parent, this method\nreturns `null`.\n\nReturn\n\n\n[Element](/apps-script/reference/xml-service/element) --- the parent `Element` node\n\n*** ** * ** ***\n\n`get``Text()` \nGets the text value of the `Text` node.\n\nReturn\n\n\n`String` --- the text value of the `Text` node\n\n*** ** * ** ***\n\n`get``Value()` \nGets the text value of all nodes that are direct or indirect children of the node, in the order\nthey appear in the document.\n\nReturn\n\n\n`String` --- the text value of all nodes that are direct or indirect children of the node\n\n*** ** * ** ***\n\n`set``Text(text)` \nSets the text value of the `Text` node.\n\nParameters\n\n| Name | Type | Description |\n|--------|----------|-----------------------|\n| `text` | `String` | the text value to set |\n\nReturn\n\n\n[Text](#) --- the `Text` node, for chaining"]]