QDomCDATASection Class
QDomCDATASection 类表示 XML CDATA 部分。更多
头文件: | #include <QDomCDATASection> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Xml) target_link_libraries(mytarget PRIVATE Qt6::Xml) |
qmake: | QT += xml |
继承: | QDomText |
- 所有成员(包括继承成员)的列表
- QDomCDATASection 属于XML 类。
注意:该类中的所有函数都是可重入的。
公共函数
QDomCDATASection() | |
QDomCDATASection(const QDomCDATASection &cdataSection) | |
QDomNode::NodeType | nodeType() const |
QDomCDATASection & | operator=(const QDomCDATASection &other) |
详细说明
CDATA 部分用于转义包含字符的文本块,否则这些字符将被视为标记。CDATA 部分中唯一可识别的分隔符是 CDATA 部分结尾的"]]> "字符串。CDATA 部分不能嵌套。它们的主要用途是包含 XML 片段等材料,而无需转义所有分隔符。
相邻的 QDomCDATASection 节点不会被QDomNode::normalize() 函数合并。
有关文档对象模型的更多信息,请参阅http://www.w3.org/TR/REC-DOM-Level-1/和http://www.w3.org/TR/DOM-Level-2-Core/。有关 DOM 实现的一般介绍,请参阅QDomDocument 文档。
成员函数文档
QDomCDATASection::QDomCDATASection()
构造一个空的 CDATA 部分。要创建有内容的 CDATA 部分,请使用QDomDocument::createCDATASection() 函数。
QDomCDATASection::QDomCDATASection(const QDomCDATASection &cdataSection)
构造cdataSection 的副本。
副本的数据是共享的(浅层副本):修改一个节点也会改变另一个节点。如果要进行深度复制,请使用cloneNode() 。
QDomNode::NodeType QDomCDATASection::nodeType() const
返回CDATASection
。
QDomCDATASection &QDomCDATASection::operator=(const QDomCDATASection &other)
为该 CDATA 部分指定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.