QDomProcessingInstructionclass represents an XML processing instruction. 更多 …
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 withsetData(). The processing instruction’s target is retrieved withtarget().有关文档对象模型的进一步信息,见 级别 1 and 级别 2 核心 。有关 DOM 实现的更一般介绍,见
QDomDocument文档编制。
QDomProcessingInstruction
¶
QDomProcessingInstruction(x)
- param x
构造空处理指令。使用
createProcessingInstruction()
to create a processing instruction with content.
PySide2.QtXml.QDomProcessingInstruction.
data
(
)
¶
unicode
返回此处理指令的内容。
PySide2.QtXml.QDomProcessingInstruction.
setData
(
d
)
¶
d – unicode
将处理指令中包含的数据设为
d
.
另请参阅