Class DocType
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
DocType
การนําเสนอโหนด XML DocumentType
เอกสารประกอบโดยละเอียด
detach()
แยกโหนดออกจากโหนด Element
หลัก หากโหนดไม่มีโหนดหลัก วิธีนี้จะไม่มีผล
รีเทิร์น
Content
— โหนดที่แยกออก
getElementName()
รับชื่อของโหนด Element
หลักที่ระบุในการประกาศ DocType
รีเทิร์น
String
— ชื่อของโหนด Element
รูทที่ระบุไว้ในประกาศ DocType
getInternalSubset()
รับข้อมูลชุดย่อยภายในของโหนด DocumentType
รีเทิร์น
String
— ข้อมูลชุดย่อยภายใน
getParentElement()
รับโหนด Element
หลักของโหนด หากโหนดไม่มีโหนดหลัก วิธีการนี้จะแสดงผลเป็น null
รีเทิร์น
Element
— โหนด Element
หลัก
getPublicId()
รับรหัสสาธารณะของข้อมูลชุดย่อยภายนอกสําหรับโหนด DocumentType
รีเทิร์น
String
— รหัสสาธารณะของข้อมูลชุดย่อยภายนอก
getSystemId()
รับรหัสระบบของข้อมูลชุดย่อยภายนอกสําหรับโหนด DocumentType
รีเทิร์น
String
— รหัสระบบของข้อมูลชุดย่อยภายนอก
getValue()
รับค่าข้อความของโหนดทั้งหมดที่เป็นโหนดย่อยโดยตรงหรือโดยอ้อมของโหนดนั้นๆ ตามลำดับที่ปรากฏในเอกสาร
รีเทิร์น
String
— ค่าข้อความของโหนดทั้งหมดที่เป็นโหนดย่อยโดยตรงหรือโดยอ้อมของโหนด
setElementName(name)
ตั้งชื่อโหนด Element
รูทที่จะระบุในการประกาศ DocType
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
name | String | ชื่อของโหนด Element หลักที่จะระบุในการประกาศ DocType |
รีเทิร์น
DocType
— โหนด DocumentType
สำหรับเชน
setInternalSubset(data)
ตั้งค่าข้อมูลชุดย่อยภายในสําหรับโหนด DocumentType
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
data | String | ข้อมูลชุดย่อยภายในที่จะตั้งค่า |
รีเทิร์น
DocType
— โหนด DocumentType
สำหรับเชน
setPublicId(id)
ตั้งค่ารหัสสาธารณะของข้อมูลชุดย่อยภายนอกสําหรับโหนด DocumentType
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
id | String | รหัสสาธารณะของข้อมูลชุดย่อยภายนอกที่จะตั้งค่า |
รีเทิร์น
DocType
— โหนด DocumentType
สำหรับเชน
setSystemId(id)
กําหนดรหัสระบบของข้อมูลชุดย่อยภายนอกสําหรับโหนด DocumentType
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
id | String | รหัสระบบของข้อมูลชุดย่อยภายนอกที่จะตั้งค่า |
รีเทิร์น
DocType
— โหนด DocumentType
สำหรับเชน
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eDocType\u003c/code\u003e represents an XML \u003ccode\u003eDocumentType\u003c/code\u003e node and provides methods to interact with its properties.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and modify properties like the root element name, internal/external subset data, and public/system IDs.\u003c/p\u003e\n"],["\u003cp\u003eMethods are available to detach the node, get its parent element, and retrieve its text value.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows manipulation of the \u003ccode\u003eDocumentType\u003c/code\u003e declaration within an XML document using Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the detailed documentation and method table for comprehensive information and examples.\u003c/p\u003e\n"]]],["The `DocType` node represents an XML Document Type. Key actions include detaching the node from its parent, retrieving the root element name, and accessing internal/external subset data via `getInternalSubset()`, `getPublicId()`, and `getSystemId()`. `getValue()` retrieves text from child nodes. Modification methods include setting the root element name, internal subset data, public ID, and system ID using `setElementName()`, `setInternalSubset()`, `setPublicId()`, and `setSystemId()`, respectively. There is also `getParentElement()` to get the parent Element.\n"],null,["# Class DocType\n\nDocType\n\nA representation of an XML `Document``Type` node. \n\n### Methods\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| [getElementName()](#getElementName()) | `String` | Gets the name of the root [Element](/apps-script/reference/xml-service/element) node specified in the `Doc``Type` declaration. |\n| [getInternalSubset()](#getInternalSubset()) | `String` | Gets the internal subset data for the `Document``Type` 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| [getPublicId()](#getPublicId()) | `String` | Gets the public ID of the external subset data for the `Document``Type` node. |\n| [getSystemId()](#getSystemId()) | `String` | Gets the system ID of the external subset data for the `Document``Type` 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| [setElementName(name)](#setElementName(String)) | [DocType](#) | Sets the name of the root [Element](/apps-script/reference/xml-service/element) node to specify in the `Doc``Type` declaration. |\n| [setInternalSubset(data)](#setInternalSubset(String)) | [DocType](#) | Sets the internal subset data for the `Document``Type` node. |\n| [setPublicId(id)](#setPublicId(String)) | [DocType](#) | Sets the public ID of the external subset data for the `Document``Type` node. |\n| [setSystemId(id)](#setSystemId(String)) | [DocType](#) | Sets the system ID of the external subset data for the `Document``Type` node. |\n\nDetailed documentation\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](/apps-script/reference/xml-service/content) --- the detached node\n\n*** ** * ** ***\n\n### `get``Element``Name()`\n\nGets the name of the root [Element](/apps-script/reference/xml-service/element) node specified in the `Doc``Type` declaration.\n\n#### Return\n\n\n`String` --- the name of the root `Element` node specified in the `Doc``Type` declaration\n\n*** ** * ** ***\n\n### `get``Internal``Subset()`\n\nGets the internal subset data for the `Document``Type` node.\n\n#### Return\n\n\n`String` --- the internal subset data\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``Public``Id()`\n\nGets the public ID of the external subset data for the `Document``Type` node.\n\n#### Return\n\n\n`String` --- the public ID of the external subset data\n\n*** ** * ** ***\n\n### `get``System``Id()`\n\nGets the system ID of the external subset data for the `Document``Type` node.\n\n#### Return\n\n\n`String` --- the system ID of the external subset data\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\n\n*** ** * ** ***\n\n### `set``Element``Name(name)`\n\nSets the name of the root [Element](/apps-script/reference/xml-service/element) node to specify in the `Doc``Type`\ndeclaration.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|-------------------------------------------------------------------------------|\n| `name` | `String` | the name of the root `Element` node to specify in the `Doc``Type` declaration |\n\n#### Return\n\n\n[DocType](#) --- the `Document``Type` node, for chaining\n\n*** ** * ** ***\n\n### `set``Internal``Subset(data)`\n\nSets the internal subset data for the `Document``Type` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|---------------------------------|\n| `data` | `String` | the internal subset data to set |\n\n#### Return\n\n\n[DocType](#) --- the `Document``Type` node, for chaining\n\n*** ** * ** ***\n\n### `set``Public``Id(id)`\n\nSets the public ID of the external subset data for the `Document``Type` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|------|----------|--------------------------------------------------|\n| `id` | `String` | the public ID of the external subset data to set |\n\n#### Return\n\n\n[DocType](#) --- the `Document``Type` node, for chaining\n\n*** ** * ** ***\n\n### `set``System``Id(id)`\n\nSets the system ID of the external subset data for the `Document``Type` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|------|----------|--------------------------------------------------|\n| `id` | `String` | the system ID of the external subset data to set |\n\n#### Return\n\n\n[DocType](#) --- the `Document``Type` node, for chaining"]]