Class EntityRef
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
EntityRef
ייצוג של צומת EntityReference
ב-XML.
מסמכים מפורטים
detach()
ניתוק הצומת מצומת ההורה Element
. אם לצומת אין הורה, ל-method הזו אין השפעה.
חזרה
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
, לצורך קישור
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]