成员函数
1、QDomElement(const QDomElement &x)
QDomElement & operator=(const QDomElement &x)
构造 x 的副本。副本的数据是共享的(浅拷贝),修改一个节点也会改变另一个。如果要进行深度复制,请使用 cloneNode()。
2、QString attribute(const QString &name, const QString &defValue = QString())
返回名为 name 的属性值。 如果该属性不存在,则返回 defValue。
3、QString attributeNS(const QString nsURI, const QString &localName, const QString &defValue = QString())
返回具有本地名称 localName 和命名空间 nsURI 的属性。如果该属性不存在,则返回 defValue。
4、QDomAttr attributeNode(const QString &name)
返回与名为 name 的属性对应的 QDomAttr 对象。如果不存在这样的属性,则返回空属性。
5、QDomAttr attributeNodeNS(const QString &nsURI, const QString &localName)
返回与具有本地名称 localName 和命名空间 nsURI 的属性对应的 QDomAttr 对象。 如果不存在这样的属性,则返回空属性。
6、QDomNamedNodeMap attributes()
返回包含此元素所有属性的 QDomNamedNodeMap。
7、QDomNodeList elementsByTagName(const QString &tagname)
返回以该元素为根元素子树的先序遍历过程中遇到的名为 tagname 的该元素的所有后代。
8、QDomNodeList elementsByTagNameNS(const QString &nsURI, const QString &localName)
返回以该元素为根元素子树的先序遍历过程中遇到的具有本地名称 localName 和命名空间 nsURI 的该元素的所有后代。
9、bool hasAttribute(const QString &name)
此元素是否具有属性。
此函数不考虑命名空间的存在。 因此,将针对包含可能存在的任何命名空间前缀的完全限定属性名称测试指定的名称。
10、bool hasAttributeNS(const QString &nsURI, const QString &localName)
元素是否具有本地名称 localName 和命名空间nsURI 的属性。
11、void removeAttribute(const QString &name)
从此元素中删除名为 name name 的属性。
12、void removeAttributeNS(const QString &nsURI, const QString &localName)
从此元素中删除具有本地名称 localName 和命名空间 nsURI 的属性。
13、QDomAttr removeAttributeNode(const QDomAttr &oldAttr)
从元素中移除属性 oldAttr 并返回它。
14、QDomAttr setAttributeNode(const QDomAttr &newAttr)
将属性 newAttr 添加到此元素。
如果该元素具有与 newAttr 同名的另一个属性,则此函数将替换该属性并返回它。
15、void setTagName(const QString &name)
设置标签名称。
16、QString text()
返回元素文本。
此函数忽略注释。它只考虑QDomText 和 QDomCDATASection 对象。