QXmlItem¶

Synopsis¶
Functions¶
def
isAtomicValue()def
isNode()def
isNull()def
toAtomicValue()def
toNodeModelIndex()
Detailed Description¶
In XQuery , all expressions evaluate to a sequence of items, where each item is either an XML node or an atomic value. The query in the following snippet evaluates to sequence of five items.
<Code snippet "/data/snapshot-qt5full-5.15/qt5/qtbase/patternist/items.xq" not found>The five items are: An element, an atomic value (binary data encoded in base64), a date, a float, and an attribute.
QXmlItemis the class that represents these XQuery items in the Qt XML Patterns API. A non-null instance ofQXmlItemis either a node or an atomic value. CallingisNode()orisAtomicValue()tells you which it is. Atomic values are represented elsewhere in the Qt API as instances ofQVariant, and an instance ofQXmlItemthat represents an atomic value can be converted to aQVariantby callingtoAtomicValue(). AQXmlItemthat wraps a node is represented elsewhere as an instance ofQXmlNodeModelIndex. A nodeQXmlItemcan be converted to aQXmlNodeModelIndexby callingtoNodeModelIndex().A default constructed
QXmlIteminstance is neither a node nor an atomic value. It is considered null, in which caseisNull()returns true.An instance of
QXmlItemwill be left dangling if theXML node modelit refers to is deleted, if it is aQXmlNodeModelIndex.
- class PySide2.QtXmlPatterns.QXmlItem¶
PySide2.QtXmlPatterns.QXmlItem(atomicValue)
PySide2.QtXmlPatterns.QXmlItem(other)
PySide2.QtXmlPatterns.QXmlItem(node)
- param node:
- param other:
- param atomicValue:
object
Constructs a null
QXmlItemthat is neither a node nor an atomic value.isNull()returns true for a default constructed instance.
- PySide2.QtXmlPatterns.QXmlItem.isAtomicValue()¶
- Return type:
bool
Returns true if this item is an atomic value. Returns false if it is a node or null.
- PySide2.QtXmlPatterns.QXmlItem.isNode()¶
- Return type:
bool
Returns true if this item is a Node. Returns false if it is an atomic value or null.
See also
- PySide2.QtXmlPatterns.QXmlItem.isNull()¶
- Return type:
bool
Returns true if this
QXmlItemis neither a node nor an atomic value. Default constructed instances ofQXmlItemare null.
- PySide2.QtXmlPatterns.QXmlItem.toAtomicValue()¶
- Return type:
object
If this
QXmlItemrepresents an atomic value, it is converted to an appropriateQVariantand returned. If thisQXmlItemis not an atomic value, the return value is a default constructedQVariant. You can callisAtomicValue()to test whether the item is an atomic value.See also
- PySide2.QtXmlPatterns.QXmlItem.toNodeModelIndex()¶
- Return type:
If this
QXmlItemrepresents a node, it returns the item as aQXmlNodeModelIndex. If thisQXmlItemis not a node, the return value is undefined. You can callisNode()to test whether the item is a node.See also
© 2022 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.