Class EntityRef
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
EntityRef
การนําเสนอโหนด XML EntityReference
เอกสารประกอบโดยละเอียด
detach()
แยกโหนดออกจากโหนด Element
หลัก หากโหนดไม่มีโหนดหลัก วิธีนี้จะไม่มีผล
รีเทิร์น
Content
— โหนดที่แยกออก
getName()
รับชื่อของโหนด EntityReference
รีเทิร์น
String
— ชื่อของโหนด EntityReference
getParentElement()
รับโหนด Element
หลักของโหนด หากโหนดไม่มีโหนดหลัก วิธีการนี้จะแสดงผลเป็น null
รีเทิร์น
Element
— โหนด Element
หลัก
getPublicId()
รับรหัสสาธารณะของโหนด EntityReference
หากโหนดไม่มีรหัสสาธารณะ เมธอดนี้จะแสดงผลเป็น null
รีเทิร์น
String
— รหัสสาธารณะของโหนด EntityReference
หรือ null
หากไม่มี
getSystemId()
รับรหัสระบบของโหนด EntityReference
หากโหนดไม่มีรหัสระบบ เมธอดนี้จะแสดงผลเป็น null
รีเทิร์น
String
— รหัสระบบของโหนด EntityReference
หรือ null
หากไม่มี
getValue()
รับค่าข้อความของโหนดทั้งหมดที่เป็นโหนดย่อยโดยตรงหรือโดยอ้อมของโหนดนั้นๆ ตามลำดับที่ปรากฏในเอกสาร
รีเทิร์น
String
— ค่าข้อความของโหนดทั้งหมดที่เป็นโหนดย่อยโดยตรงหรือโดยอ้อมของโหนด
setName(name)
ตั้งชื่อโหนด EntityReference
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
name | String | ชื่อที่จะตั้ง |
รีเทิร์น
EntityRef
— โหนด EntityReference
สำหรับเชน
setPublicId(id)
ตั้งค่ารหัสสาธารณะของโหนด EntityReference
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
id | String | รหัสสาธารณะที่จะตั้งค่า |
รีเทิร์น
EntityRef
— โหนด EntityReference
สำหรับเชน
setSystemId(id)
ตั้งค่ารหัสระบบของโหนด EntityReference
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
id | String | รหัสระบบที่จะตั้งค่า |
รีเทิร์น
EntityRef
— โหนด EntityReference
สำหรับเชน
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eEntityRef\u003c/code\u003e represents an XML \u003ccode\u003eEntityReference\u003c/code\u003e node, providing methods to interact with and modify it within a document.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to get and set the name, public ID, and system ID of the entity reference.\u003c/p\u003e\n"],["\u003cp\u003eYou can detach the node from its parent, retrieve its text value, and access its parent element using provided methods.\u003c/p\u003e\n"],["\u003cp\u003eThis class facilitates working with external entities referenced within an XML document using Apps Script's XML Service.\u003c/p\u003e\n"]]],["The `EntityRef` represents an XML entity reference node. Key actions include: getting the node's name, parent element, public ID, system ID, and the text value of its children. It also allows detaching from its parent. You can set the node's name, public ID, and system ID. If the node doesn't have a parent, public ID, or system ID, methods will return null or have no effect.\n"],null,["# Class EntityRef\n\nEntityRef\n\nA representation of an XML `Entity``Reference` 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| [getName()](#getName()) | `String` | Gets the name of the `Entity``Reference` 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 `Entity``Reference` node. |\n| [getSystemId()](#getSystemId()) | `String` | Gets the system ID of the `Entity``Reference` 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| [setName(name)](#setName(String)) | [EntityRef](#) | Sets the name of the `Entity``Reference` node. |\n| [setPublicId(id)](#setPublicId(String)) | [EntityRef](#) | Sets the public ID of the `Entity``Reference` node. |\n| [setSystemId(id)](#setSystemId(String)) | [EntityRef](#) | Sets the system ID of the `Entity``Reference` 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``Name()`\n\nGets the name of the `Entity``Reference` node.\n\n#### Return\n\n\n`String` --- the name of the `Entity``Reference` 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``Public``Id()`\n\nGets the public ID of the `Entity``Reference` node. If the node does not have a public ID,\nthis method returns `null`.\n\n#### Return\n\n\n`String` --- the public ID of the `Entity``Reference` node, or `null` if it has none\n\n*** ** * ** ***\n\n### `get``System``Id()`\n\nGets the system ID of the `Entity``Reference` node. If the node does not have a system ID,\nthis method returns `null`.\n\n#### Return\n\n\n`String` --- the system ID of the `Entity``Reference` node, or `null` if it has none\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``Name(name)`\n\nSets the name of the `Entity``Reference` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|-----------------|\n| `name` | `String` | the name to set |\n\n#### Return\n\n\n[EntityRef](#) --- the `Entity``Reference` node, for chaining\n\n*** ** * ** ***\n\n### `set``Public``Id(id)`\n\nSets the public ID of the `Entity``Reference` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|------|----------|----------------------|\n| `id` | `String` | the public ID to set |\n\n#### Return\n\n\n[EntityRef](#) --- the `Entity``Reference` node, for chaining\n\n*** ** * ** ***\n\n### `set``System``Id(id)`\n\nSets the system ID of the `Entity``Reference` node.\n\n#### Parameters\n\n| Name | Type | Description |\n|------|----------|----------------------|\n| `id` | `String` | the system ID to set |\n\n#### Return\n\n\n[EntityRef](#) --- the `Entity``Reference` node, for chaining"]]