QDomProcessingInstruction 类

QDomProcessingInstruction class represents an XML processing instruction. 更多...

头: #include <QDomProcessingInstruction>
qmake: QT += xml
继承: QDomNode

注意: 此类的所有函数 可重入 .

公共函数

QDomProcessingInstruction ()
QDomProcessingInstruction (const QDomProcessingInstruction & x )
QString data () const
QDomNode::NodeType nodeType () const
void setData (const QString & d )
QString target () const
QDomProcessingInstruction & operator= (const QDomProcessingInstruction & x )

详细描述

QDomProcessingInstruction class represents an XML processing instruction.

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

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

不要使用此函数来创建 XML 声明,因为尽管它拥有如处理指令相同句法,但它不是处理指令且可能不会被 QDom 这样对待。

处理指令内容的检索采用 data () 和设置采用 setData ()。处理指令目标的检索采用 target ().

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

成员函数文档编制

QDomProcessingInstruction:: QDomProcessingInstruction ()

构造空处理指令。使用 QDomDocument::createProcessingInstruction () 以创建带有内容的处理指令。

QDomProcessingInstruction:: QDomProcessingInstruction (const QDomProcessingInstruction & x )

构造副本为 x .

拷贝数据是共享的 (浅拷贝):修改一个节点也将改变另一节点。若想要制作深度副本,使用 cloneNode ().

QString QDomProcessingInstruction:: data () const

返回此处理指令的内容。

另请参阅 setData () 和 target ().

QDomNode::NodeType QDomProcessingInstruction:: nodeType () const

返回 ProcessingInstructionNode .

void QDomProcessingInstruction:: setData (const QString & d )

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

另请参阅 data ().

QString QDomProcessingInstruction:: target () const

返回此处理指令的目标。

另请参阅 data ().

QDomProcessingInstruction &QDomProcessingInstruction:: operator= (const QDomProcessingInstruction & x )

赋值 x 到此处理指令。

拷贝数据是共享的 (浅拷贝):修改一个节点也将改变另一节点。若想要制作深度副本,使用 cloneNode ().