[[["易于理解","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):2025-07-26。"],[[["\u003cp\u003eRepresents an XML \u003ccode\u003eComment\u003c/code\u003e node, providing methods for interaction.\u003c/p\u003e\n"],["\u003cp\u003eAllows detachment from parent element, retrieval of parent/text values, and text modification.\u003c/p\u003e\n"],["\u003cp\u003eIncludes \u003ccode\u003egetText()\u003c/code\u003e for the comment's text and \u003ccode\u003egetValue()\u003c/code\u003e for text of all child nodes.\u003c/p\u003e\n"],["\u003cp\u003eOffers \u003ccode\u003esetText()\u003c/code\u003e to modify the comment's text and \u003ccode\u003edetach()\u003c/code\u003e to remove it from its parent.\u003c/p\u003e\n"]]],["An XML `Comment` node can be manipulated using several methods. `detach()` removes the node from its parent element. `getParentElement()` retrieves the parent `Element` node, if any. `getText()` and `getValue()` return the text content of the `Comment` node and its children respectively. The `setText(text)` method updates the text content of the `Comment` node and supports method chaining by returning the updated `Comment` node.\n"],null,["Comment\n\nA representation of an XML `Comment` node. \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\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 `Comment` 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)) | [Comment](#) | Sets the text value of the `Comment` node. |\n\nDetailed documentation \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 `Comment` node.\n\nReturn\n\n\n`String` --- the text value of the `Comment` 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 `Comment` node.\n\nParameters\n\n| Name | Type | Description |\n|--------|----------|-----------------------|\n| `text` | `String` | the text value to set |\n\nReturn\n\n\n[Comment](#) --- the `Comment` node, for chaining"]]