Dom 简明教程

DOM - ProcessingInstruction Object

ProcessingInstruction 提供应用程序特定的信息,通常包含在 XML 文档的前言部分。

ProcessingInstruction gives that application-specific information which is generally included in the prolog section of the XML document.

处理指令 (PI) 可用于向应用程序传递信息。PI 可以出现在标记之外的文档中的任何位置。它们可以出现在前言中,包括文档类型定义 (DTD)、文本内容中或文档之后。

Processing instructions (PIs) can be used to pass information to applications. PIs can appear anywhere in the document outside the markup. They can appear in the prolog, including the document type definition (DTD), in textual content, or after the document.

PI 以特殊标记 <? 开头,以 ?> 结尾。在遇到字符串 ?> 后,内容的处理将立即结束。

A PI starts with a special tag <? and ends with ?>. Processing of the contents ends immediately after the string ?> is encountered.

Attributes

下表列出了 ProcessingInstruction 对象的属性 −

The following table lists the attributes of the ProcessingInstruction object −

Attribute

Type

Description

data

DOMString

It is a character that describes the information for the application to process immediately preceding the ?>.

target

DOMString

This identifies the application to which the instruction or the data is directed.