内容表

上一话题

QDomNotation

下一话题

QDomText

QDomProcessingInstruction

QDomProcessingInstruction class represents an XML processing instruction. 更多

Inheritance diagram of PySide2.QtXml.QDomProcessingInstruction

概要

函数

详细描述

XML 使用处理指令将特定处理器信息保持在文档的文本中。

出现在 XML 文档顶部的 XML 声明,通常为 <?xml version='1.0' encoding='UTF-8'?> ,QDom 将其视为处理指令。这很不幸,因为 XML 声明不是处理指令;除其它差异外,不可以将其插入文档任何地方,但可插入第一行。

Do not use this function to create an xml declaration, since although it has the same syntax as a processing instruction, it isn’t, and might not be treated by QDom as such.

处理指令内容的检索采用 data() and set with setData() . The processing instruction’s target is retrieved with target() .

有关文档对象模型的进一步信息,见 级别 1 and 级别 2 核心 。有关 DOM 实现的更一般介绍,见 QDomDocument 文档编制。

class QDomProcessingInstruction

QDomProcessingInstruction(x)

param x

QDomProcessingInstruction

构造空处理指令。使用 createProcessingInstruction() to create a processing instruction with content.

PySide2.QtXml.QDomProcessingInstruction. data ( )
返回类型

unicode

返回此处理指令的内容。

PySide2.QtXml.QDomProcessingInstruction. setData ( d )
参数

d – unicode

将处理指令中包含的数据设为 d .

另请参阅

data()

PySide2.QtXml.QDomProcessingInstruction. target ( )
返回类型

unicode

返回此处理指令的目标。

另请参阅

data()