Processing Instruction Information Items

Processing instructions (PIs) are used within XML documents to capture information that doesn’t necessarily fit into the nested structure found elsewhere. Such data doesn’t need to relate to processing tasks, although that’s one historical use for such constructs.

Property

Callbacks

Explanation

[target]

ContentHandler.processingInstruction(), target parameter

[content]

ContentHandler.processingInstruction(), target parameter

[base URI]

computed using xml:base

In the absence of xml:base attributes, this property is normally the value that Locator.getSystemId() exposes during the processingInstruction() callback.

[notation]

See the section on Notation Information Items. Tracking notations is the responsibility of applications.

[parent]

When startElement() is invoked with no matching endElement(), the parent is the current element. Between calls to LexicalHandler.startDTD() and LexicalHandler.endDTD(), the parent is the Document Type Declaration. Otherwise, the document itself is the parent.

Some applications use a convention that PI target names are matched against notation declarations, and the notations’ public (or system) IDs are used to deduce the meaning behind a given PI. For example, such an ID might indicate a particular tool to use on receipt of a document (preferably redirecting through a table to facilitate useful security constraints). This is purely a convention, but it’s recognized by the ...

Get SAX2 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.