QDomDocumentType Class

QDomDocumentType 类是文档树中 DTD 的表示形式。更多

头文件: #include <QDomDocumentType>
CMake: find_package(Qt6 REQUIRED COMPONENTS Xml)
target_link_libraries(mytarget PRIVATE Qt6::Xml)
qmake: QT += xml
继承: QDomNode

注意:该类中的所有函数都是可重入的

公共函数

QDomDocumentType()
QDomDocumentType(const QDomDocumentType &documentType)
QDomNamedNodeMap entities() const
QString internalSubset() const
QString name() const
QDomNode::NodeType nodeType() const
QDomNamedNodeMap notations() const
QString publicId() const
QString systemId() const
QDomDocumentType &operator=(const QDomDocumentType &other)

详细描述

QDomDocumentType 类允许对 DTD 中的某些数据结构进行只读访问:它可以返回所有entities() 和notations() 的映射。此外,函数name() 返回 &lt;!DOCTYPE name&gt; 标记中指定的文档类型名称。该类还提供publicId(),systemId() 和internalSubset() 函数。

另请参阅 QDomDocument

成员函数文档

QDomDocumentType::QDomDocumentType()

创建一个空的 QDomDocumentType 对象。

QDomDocumentType::QDomDocumentType(const QDomDocumentType &documentType)

构造documentType 的副本。

副本的数据是共享的(浅层副本):修改一个节点也会改变另一个节点。如果要进行深度复制,请使用cloneNode() 。

QDomNamedNodeMap QDomDocumentType::entities() const

返回 DTD 中描述的所有实体的映射。

QString QDomDocumentType::internalSubset() const

返回文档类型的内部子集,如果没有内部子集,则返回空字符串。

另请参阅 publicId() 和systemId()。

QString QDomDocumentType::name() const

返回 &lt;!DOCTYPE name&gt; 标记中指定的文档类型名称。

另请参阅 nodeName().

QDomNode::NodeType QDomDocumentType::nodeType() const

返回DocumentTypeNode

另请参见 isDocumentType() 和QDomNode::toDocumentType()。

QDomNamedNodeMap QDomDocumentType::notations() const

返回 DTD 中描述的所有符号的映射。

QString QDomDocumentType::publicId() const

返回外部 DTD 子集的公共标识符,如果没有公共标识符,则返回空字符串。

另请参阅 systemId()、internalSubset() 和QDomImplementation::createDocumentType()。

QString QDomDocumentType::systemId() const

返回外部 DTD 子集的系统标识符,如果没有系统标识符,则返回空字符串。

另请参阅 publicId()、internalSubset() 和QDomImplementation::createDocumentType()。

QDomDocumentType &QDomDocumentType::operator=(const QDomDocumentType &other)

为该文档类型指定other

副本的数据是共享的(浅层副本):修改一个节点也会改变另一个节点。如果要进行深度复制,请使用cloneNode()。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.