QDomEntity Class
QDomEntity 类代表一个 XML 实体。更多
Header: | #include <QDomEntity> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Xml) target_link_libraries(mytarget PRIVATE Qt6::Xml) |
qmake: | QT += xml |
继承: | QDomNode |
- 所有成员(包括继承成员)的列表
- QDomEntity 属于XML 类。
注意:该类中的所有函数都是可重入的。
公共函数
QDomEntity() | |
QDomEntity(const QDomEntity &entity) | |
QDomNode::NodeType | nodeType() const |
QString | notationName() const |
QString | publicId() const |
QString | systemId() const |
QDomEntity & | operator=(const QDomEntity &other) |
详细描述
该类表示 XML 文档中的一个实体,可以是已解析的实体,也可以是未解析的实体。请注意,该类是实体本身的模型,而不是实体声明的模型。
DOM 不支持编辑实体节点;如果用户要更改实体的内容,必须在 DOM 树中用实体内容的克隆来替换每个相关的QDomEntityReference 节点,然后再对每个克隆进行所需的更改。实体节点的所有子节点都是只读的。
实体节点没有父节点。
当实体的publicId(),systemId() 和notationName() 可用时,您可以访问它们。
有关文档对象模型的更多信息,请参阅第 1 级和第 2 级核心。有关 DOM 实现的一般介绍,请参阅QDomDocument 文档。
成员函数文档
QDomEntity::QDomEntity()
构造一个空实体。
QDomEntity::QDomEntity(const QDomEntity &entity)
构造entity 的副本。
副本的数据是共享的(浅层副本):修改一个节点也会改变另一个节点。如果要进行深度复制,请使用cloneNode() 。
QDomNode::NodeType QDomEntity::nodeType() const
返回EntityNode
。
QString QDomEntity::notationName() const
对于未解析的实体,该函数返回实体的符号名称。对于已解析的实体,该函数返回空字符串。
QString QDomEntity::publicId() const
返回与此实体相关的公共标识符。如果未指定公共标识符,则返回空字符串。
QString QDomEntity::systemId() const
返回与该实体相关的系统标识符。如果未指定系统标识符,则返回空字符串。
QDomEntity &QDomEntity::operator=(const QDomEntity &other)
为该 DOM 实体指定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.