The ProcessingInstruction Interface

The ProcessingInstruction interface represents a processing instruction such as <?xml-stylesheet type="text/css" href="order.css"?> or <?php echo "Hello World";?>.

Example 11.17 summarizes the ProcessingInstruction interface. This interface adds methods to get the target and the data of the processing instruction as strings. Even if the data has a pseudo-attribute format, as in <?xml-stylesheet type="text/css" href="order.css"?>, DOM doesn't recognize that. For this processing instruction, the target is xml-stylesheet and the data is type="text/css" href="order.css."

Example 11.17. The ProcessingInstruction Interface
 package org.w3c.dom; public interface ProcessingInstruction extends Node { public String getTarget(); ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.