Processing instructions

Processing instructions are represented by ProcessingInstruction nodes. The name of this type of node is the name of the target application (the first word in the tag). The value of this type of node is the instruction data that occupies the body of the tag.

The whitespace between the target and the instruction is implied, and parsers will insert a single space between them when writing out to XML format. The methods defined by this interface are:

String  getTarget();
String  getData();
void    setData(String data);

Consider the following example, which is referred to below. It consists of a target name of 'ACME' and an instruction of 'page-break':

<?ACME page-break ?>

Get target or data

The getTarget method returns the ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.