今天我来翻译一下这个qt中QDomElenment这个类。原文档是官方的文档!
the QDomElement class represents one element in the DOM tree.
Elements have a tagName() and zero or more attributes associated with them. The tag name can be changed with setTagName().
Element attributes are represented by QDomAttr objects that can be queried using the attribute() and attributeNode() functions. You can set attributes with the setAttribute() and setAttributeNode() functions. Attributes can be removed with removeAttribute(). There are namespace-aware equivalents to these functions, i.e. setAttributeNS(), setAttributeNodeNS() and removeAttributeNS().
If you want to access the text of a node use text(), e.g.
这个类代表了元素在Dom树中。
元素有一个标签名,有0个或更多的属性联合它们。那个标签名可以改变用 setTagName().元素属性用QDomAttr 对象代表,查询可以用attribute() and attributeNode()查询属性和返回一个QDomAttr,
The text() function operates recursively to find the text (since not all elements contain text). If you want to find all the text in all of a node's children, iterate over the children looking for QDomText nodes, e.g.