Class ProcessingInstruction
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Xử lýHướng dẫn
Biểu thị nút ProcessingInstruction
XML.
Phương thức
Phương thức | Loại dữ liệu trả về | Mô tả ngắn |
detach() | Content | Tách nút này khỏi nút Element mẹ. |
getData() | String | Lấy dữ liệu thô cho mọi lệnh trong nút ProcessingInstruction . |
getParentElement() | Element | Lấy nút Element mẹ của nút. |
getTarget() | String | Lấy mục tiêu cho nút ProcessingInstruction . |
getValue() | String | Lấy giá trị văn bản của tất cả các nút là phần tử con trực tiếp hoặc gián tiếp của nút, theo thứ tự xuất hiện trong tài liệu. |
Tài liệu chi tiết
detach()
Tách nút này khỏi nút Element
mẹ. Nếu nút không có nút mẹ, phương thức này sẽ không có hiệu lực.
Cầu thủ trả bóng
Content
– nút đã tách
getData()
Lấy dữ liệu thô cho mọi lệnh trong nút ProcessingInstruction
.
Cầu thủ trả bóng
String
– dữ liệu thô cho mọi lệnh trong nút ProcessingInstruction
getParentElement()
Lấy nút Element
mẹ của nút. Nếu nút không có nút mẹ, phương thức này sẽ trả về null
.
Cầu thủ trả bóng
Element
– nút Element
mẹ
getTarget()
Lấy mục tiêu cho nút ProcessingInstruction
.
Cầu thủ trả bóng
String
– mục tiêu cho nút ProcessingInstruction
getValue()
Lấy giá trị văn bản của tất cả các nút là phần tử con trực tiếp hoặc gián tiếp của nút, theo thứ tự xuất hiện trong tài liệu.
Cầu thủ trả bóng
String
– giá trị văn bản của tất cả các nút là phần tử con trực tiếp hoặc gián tiếp của nút
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eRepresents an XML \u003ccode\u003eProcessingInstruction\u003c/code\u003e node, providing methods for interaction.\u003c/p\u003e\n"],["\u003cp\u003eOffers methods to detach from parent, retrieve raw data, get parent element, target, and text value.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edetach()\u003c/code\u003e removes the node from its parent, \u003ccode\u003egetData()\u003c/code\u003e retrieves raw instruction data, and \u003ccode\u003egetParentElement()\u003c/code\u003e fetches the parent node.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetTarget()\u003c/code\u003e retrieves the processing instruction's target, and \u003ccode\u003egetValue()\u003c/code\u003e gets the text value of its children.\u003c/p\u003e\n"]]],[],null,["# Class ProcessingInstruction\n\nProcessingInstruction\n\nA representation of an XML `Processing``Instruction` 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| [getData()](#getData()) | `String` | Gets the raw data for every instruction in the `Processing``Instruction` 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| [getTarget()](#getTarget()) | `String` | Gets the target for the `Processing``Instruction` 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\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``Data()`\n\nGets the raw data for every instruction in the `Processing``Instruction` node.\n\n#### Return\n\n\n`String` --- the raw data for every instruction in the `Processing``Instruction` 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``Target()`\n\nGets the target for the `Processing``Instruction` node.\n\n#### Return\n\n\n`String` --- the target for the `Processing``Instruction` node\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"]]