Interface Content
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
İçerik
Genel bir XML düğümünün gösterimi.
Sınıfları uygulama
Ad | Kısa açıklama |
Cdata | Bir XML CDATASection düğümünün temsili. |
Comment | Bir XML Comment düğümünün temsili. |
DocType | Bir XML DocumentType düğümünün temsili. |
Element | Bir XML Element düğümünün temsili. |
EntityRef | Bir XML EntityReference düğümünün temsili. |
ProcessingInstruction | Bir XML ProcessingInstruction düğümünün temsili. |
Text | Bir XML Text düğümünün temsili. |
Ayrıntılı dokümanlar
asCdata()
Düğümü, otomatik tamamlama amacıyla CDATASection
düğümü olarak yayınlar. Nodun ContentType
değeri CDATA
değilse bu yöntem null
değerini döndürür.
Return
Cdata
: CDATASection
düğümü
asDocType()
Düğümü, otomatik tamamlama amacıyla DocumentType
düğümü olarak yayınlar. Düğümün ContentType
değeri DOCTYPE
değilse bu yöntem null
değerini döndürür.
Return
DocType
: DocumentType
düğümü
asElement()
Düğümü, otomatik tamamlama amacıyla Element
düğümü olarak yayınlar. Düğümün ContentType
değeri ELEMENT
değilse bu yöntem null
değerini döndürür.
Return
Element
: Element
düğümü
asEntityRef()
Düğümü, otomatik tamamlama amacıyla EntityReference
düğümü olarak yayınlar.
Düğümün ContentType
değeri ENTITYREF
değilse bu yöntem null
döndürür.
Return
EntityRef
: EntityReference
düğümü
asProcessingInstruction()
asText()
Düğümü, otomatik tamamlama amacıyla Text
düğümü olarak yayınlar. Düğümün ContentType
değeri TEXT
değilse bu yöntem null
değerini döndürür.
Return
Text
: Text
düğümü
detach()
Düğümü, üst Element
düğümünden ayırır. Nodun üst öğesi yoksa bu yöntemin etkisi olmaz.
Return
Content
: ayrılmış düğüm
getParentElement()
Düğümün üst Element
düğümünü alır. Nodun üst öğesi yoksa bu yöntem null
döndürür.
Return
Element
: Üst Element
düğümü
getType()
Nodun içerik türünü alır.
Return
ContentType
: Düğümün içerik türü
getValue()
Düğümün doğrudan veya dolaylı alt öğeleri olan tüm düğümlerin metin değerini, belgede göründükleri sırayla alır.
Return
String
: Düğümün doğrudan veya dolaylı alt öğeleri olan tüm düğümlerin metin değeri
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eContent\u003c/code\u003e is a generic representation of an XML node in Google Apps Script and provides methods to interact with it.\u003c/p\u003e\n"],["\u003cp\u003eIt offers various methods to cast the node into specific types like \u003ccode\u003eElement\u003c/code\u003e, \u003ccode\u003eText\u003c/code\u003e, \u003ccode\u003eComment\u003c/code\u003e, etc., for easier manipulation.\u003c/p\u003e\n"],["\u003cp\u003eYou can detach a node from its parent, get its parent element, or retrieve its content type using dedicated methods.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetValue()\u003c/code\u003e helps retrieve the combined text value of all the node's children, providing a way to access its content.\u003c/p\u003e\n"],["\u003cp\u003eImplementing classes include \u003ccode\u003eCdata\u003c/code\u003e, \u003ccode\u003eComment\u003c/code\u003e, \u003ccode\u003eDocType\u003c/code\u003e, \u003ccode\u003eElement\u003c/code\u003e, \u003ccode\u003eEntityRef\u003c/code\u003e, \u003ccode\u003eProcessingInstruction\u003c/code\u003e, and \u003ccode\u003eText\u003c/code\u003e, representing different XML node types.\u003c/p\u003e\n"]]],["This content details a generic XML node and its interactions. It outlines seven specific XML node types: Cdata, Comment, DocType, Element, EntityRef, ProcessingInstruction, and Text. Key actions include casting a node to a specific type using `asType()` methods, which return `null` if the type is incorrect. Other actions involve `detach()` to remove a node from its parent, `getParentElement()` to find the parent, `getType()` to retrieve the content type, and `getValue()` to get the combined text value of child nodes.\n"],null,["# Interface Content\n\nContent\n\nA representation of a generic XML node.\n\n### Implementing classes\n\n| Name | Brief description |\n|------------------------------------------------------------------------------------|------------------------------------------------------------|\n| [Cdata](/apps-script/reference/xml-service/cdata) | A representation of an XML `CDATASection` node. |\n| [Comment](/apps-script/reference/xml-service/comment) | A representation of an XML `Comment` node. |\n| [DocType](/apps-script/reference/xml-service/doc-type) | A representation of an XML `Document``Type` node. |\n| [Element](/apps-script/reference/xml-service/element) | A representation of an XML `Element` node. |\n| [EntityRef](/apps-script/reference/xml-service/entity-ref) | A representation of an XML `Entity``Reference` node. |\n| [ProcessingInstruction](/apps-script/reference/xml-service/processing-instruction) | A representation of an XML `Processing``Instruction` node. |\n| [Text](/apps-script/reference/xml-service/text) | A representation of an XML `Text` node. |\n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [asCdata()](#asCdata()) | [Cdata](/apps-script/reference/xml-service/cdata) | Casts the node as a [CDATASection](/apps-script/reference/xml-service/cdata) node for the purposes of autocomplete. |\n| [asComment()](#asComment()) | [Comment](/apps-script/reference/xml-service/comment) | Casts the node as a [Comment](/apps-script/reference/xml-service/comment) node for the purposes of autocomplete. |\n| [asDocType()](#asDocType()) | [DocType](/apps-script/reference/xml-service/doc-type) | Casts the node as a [DocumentType](/apps-script/reference/xml-service/doc-type) node for the purposes of autocomplete. |\n| [asElement()](#asElement()) | [Element](/apps-script/reference/xml-service/element) | Casts the node as an [Element](/apps-script/reference/xml-service/element) node for the purposes of autocomplete. |\n| [asEntityRef()](#asEntityRef()) | [EntityRef](/apps-script/reference/xml-service/entity-ref) | Casts the node as a [EntityReference](/apps-script/reference/xml-service/entity-ref) node for the purposes of autocomplete. |\n| [asProcessingInstruction()](#asProcessingInstruction()) | [ProcessingInstruction](/apps-script/reference/xml-service/processing-instruction) | Casts the node as a [ProcessingInstruction](/apps-script/reference/xml-service/processing-instruction) node for the purposes of autocomplete. |\n| [asText()](#asText()) | [Text](/apps-script/reference/xml-service/text) | Casts the node as a [Text](/apps-script/reference/xml-service/text) node for the purposes of autocomplete. |\n| [detach()](#detach()) | [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| [getType()](#getType()) | [ContentType](/apps-script/reference/xml-service/content-type) | Gets the node's content type. |\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\nDetailed documentation\n----------------------\n\n### `as``Cdata()`\n\nCasts the node as a [CDATASection](/apps-script/reference/xml-service/cdata) node for the purposes of autocomplete. If the\nnode's [ContentType](/apps-script/reference/xml-service/content-type) is not already `CDATA`, this method returns `null`.\n\n#### Return\n\n\n[Cdata](/apps-script/reference/xml-service/cdata) --- the `CDATASection` node\n\n*** ** * ** ***\n\n### `as``Comment()`\n\nCasts the node as a [Comment](/apps-script/reference/xml-service/comment) node for the purposes of autocomplete. If the node's\n[ContentType](/apps-script/reference/xml-service/content-type) is not already `COMMENT`, this method returns `null`.\n\n#### Return\n\n\n[Comment](/apps-script/reference/xml-service/comment) --- the `Comment` node, or `null` if the node's content type is not [COMMENT](/apps-script/reference/xml-service/content-type)\n\n*** ** * ** ***\n\n### `as``Doc``Type()`\n\nCasts the node as a [DocumentType](/apps-script/reference/xml-service/doc-type) node for the purposes of autocomplete. If\nthe node's [ContentType](/apps-script/reference/xml-service/content-type) is not already `DOCTYPE`, this method returns `null`.\n\n#### Return\n\n\n[DocType](/apps-script/reference/xml-service/doc-type) --- the `Document``Type` node\n\n*** ** * ** ***\n\n### `as``Element()`\n\nCasts the node as an [Element](/apps-script/reference/xml-service/element) node for the purposes of autocomplete. If the node's\n[ContentType](/apps-script/reference/xml-service/content-type) is not already `ELEMENT`, this method returns `null`.\n\n#### Return\n\n\n[Element](/apps-script/reference/xml-service/element) --- the `Element` node\n\n*** ** * ** ***\n\n### `as``Entity``Ref()`\n\nCasts the node as a [EntityReference](/apps-script/reference/xml-service/entity-ref) node for the purposes of autocomplete.\nIf the node's [ContentType](/apps-script/reference/xml-service/content-type) is not already `ENTITYREF`, this method returns\n`null`.\n\n#### Return\n\n\n[EntityRef](/apps-script/reference/xml-service/entity-ref) --- the `Entity``Reference` node\n\n*** ** * ** ***\n\n### `as``Processing``Instruction()`\n\nCasts the node as a [ProcessingInstruction](/apps-script/reference/xml-service/processing-instruction) node for the purposes of autocomplete. If\nthe node's [ContentType](/apps-script/reference/xml-service/content-type) is not already `PROCESSINGINSTRUCTION`, this method\nreturns `null`.\n\n#### Return\n\n\n[ProcessingInstruction](/apps-script/reference/xml-service/processing-instruction) --- the `Processing``Instruction` node\n\n*** ** * ** ***\n\n### `as``Text()`\n\nCasts the node as a [Text](/apps-script/reference/xml-service/text) node for the purposes of autocomplete. If the node's [ContentType](/apps-script/reference/xml-service/content-type) is not already `TEXT`, this method returns `null`.\n\n#### Return\n\n\n[Text](/apps-script/reference/xml-service/text) --- the `Text` node\n\n*** ** * ** ***\n\n### `detach()`\n\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\n#### Return\n\n\n[Content](#) --- the detached node\n\n*** ** * ** ***\n\n### `get``Parent``Element()`\n\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\n#### Return\n\n\n[Element](/apps-script/reference/xml-service/element) --- the parent `Element` node\n\n*** ** * ** ***\n\n### `get``Type()`\n\nGets the node's content type.\n\n#### Return\n\n\n[ContentType](/apps-script/reference/xml-service/content-type) --- the node's content type\n\n*** ** * ** ***\n\n### `get``Value()`\n\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\n#### Return\n\n\n`String` --- the text value of all nodes that are direct or indirect children of the node"]]