Class ProcessingInstruction Stay organized with collections Save and categorize content based on your preferences.
Page Summary
ProcessingInstruction represents an XML ProcessingInstruction node.
It includes methods to detach the node, get its raw data, retrieve its parent element, get its target, and get its text value.
The
detach()method removes the node from its parent, returning the detached node.The
getData()method returns the raw data of the instructions within the node as a string.The
getParentElement()method returns the parent Element node or null if no parent exists.The
getTarget()method returns the target of the ProcessingInstruction node as a string.The
getValue()method returns the combined text value of all direct and indirect child nodes as a string.
A representation of an XMLProcessing node.
Methods
| Method | Return type | Brief description |
|---|---|---|
detach() | Content | Detaches the node from its parentElement node. |
get | String | Gets the raw data for every instruction in theProcessing node. |
get | Element | Gets the node's parentElement node. |
get | String | Gets the target for theProcessing node. |
get | String | Gets the text value of all nodes that are direct or indirect children of the node, in the orderthey appear in the document. |
Detailed documentation
detach()
getData()
Gets the raw data for every instruction in theProcessing node.
Return
String — the raw data for every instruction in theProcessing node
getParentElement()
getTarget()
Gets the target for theProcessing node.
Return
String — the target for theProcessing node
getValue()
Gets the text value of all nodes that are direct or indirect children of the node, in the orderthey appear in the document.
Return
String — the text value of all nodes that are direct or indirect children of the node
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.