Table Of Contents

QXmlItem

Inheritance diagram of QXmlItem

Synopsis

Functions

Detailed Description

The PySide.QtXmlPatterns.QXmlItem class contains either an XML node or an atomic value.

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.

<aNode/>,
xs:base64Binary("FFFF"),
current-date(),
3e3, (: A floating point value :)
attribute {"name"} {()}

The five items are: An element, an atomic value (binary data encoded in base64), a date, a float, and an attribute.

PySide.QtXmlPatterns.QXmlItem is the class that represents these XQuery items in the QtXmlPatterns API. A non-null instance of PySide.QtXmlPatterns.QXmlItem is either a node or an atomic value. Calling PySide.QtXmlPatterns.QXmlItem.isNode() or PySide.QtXmlPatterns.QXmlItem.isAtomicValue() tells you which it is. Atomic values are represented elsewhere in the Qt API as instances of PySide.QtCore.QVariant , and an instance of PySide.QtXmlPatterns.QXmlItem that represents an atomic value can be converted to a PySide.QtCore.QVariant by calling PySide.QtXmlPatterns.QXmlItem.toAtomicValue() . A PySide.QtXmlPatterns.QXmlItem that wraps a node is represented elsewhere as an instance of PySide.QtXmlPatterns.QXmlNodeModelIndex . A node PySide.QtXmlPatterns.QXmlItem can be converted to a PySide.QtXmlPatterns.QXmlNodeModelIndex by calling PySide.QtXmlPatterns.QXmlItem.toNodeModelIndex() .

A default constructed PySide.QtXmlPatterns.QXmlItem instance is neither a node nor an atomic value. It is considered null, in which case PySide.QtXmlPatterns.QXmlItem.isNull() returns true.

An instance of PySide.QtXmlPatterns.QXmlItem will be left dangling if the XML node model it refers to is deleted, if it is a PySide.QtXmlPatterns.QXmlNodeModelIndex .

class PySide.QtXmlPatterns.QXmlItem
class PySide.QtXmlPatterns.QXmlItem(atomicValue)
class PySide.QtXmlPatterns.QXmlItem(other)
class PySide.QtXmlPatterns.QXmlItem(node)
Parameters:

Constructs a null PySide.QtXmlPatterns.QXmlItem that is neither a node nor an atomic value. PySide.QtXmlPatterns.QXmlItem.isNull() returns true for a default constructed instance.

Constructs an atomic value PySide.QtXmlPatterns.QXmlItem with atomicValue .

The copy constructor constructs a copy of other .

Constructs a node PySide.QtXmlPatterns.QXmlItem that is a copy of node .

PySide.QtXmlPatterns.QXmlItem.internalIsAtomicValue()
Return type:PySide.QtCore.bool
PySide.QtXmlPatterns.QXmlItem.isAtomicValue()
Return type:PySide.QtCore.bool

Returns true if this item is an atomic value. Returns false if it is a node or null.

PySide.QtXmlPatterns.QXmlItem.isNode()
Return type:PySide.QtCore.bool

Returns true if this item is a Node. Returns false if it is an atomic value or null.

PySide.QtXmlPatterns.QXmlItem.isNull()
Return type:PySide.QtCore.bool

Returns true if this PySide.QtXmlPatterns.QXmlItem is neither a node nor an atomic value. Default constructed instances of PySide.QtXmlPatterns.QXmlItem are null.

PySide.QtXmlPatterns.QXmlItem.toAtomicValue()
Return type:object

If this PySide.QtXmlPatterns.QXmlItem represents an atomic value, it is converted to an appropriate PySide.QtCore.QVariant and returned. If this PySide.QtXmlPatterns.QXmlItem is not an atomic value, the return value is a default constructed PySide.QtCore.QVariant . You can call PySide.QtXmlPatterns.QXmlItem.isAtomicValue() to test whether the item is an atomic value.

PySide.QtXmlPatterns.QXmlItem.toNodeModelIndex()
Return type:PySide.QtXmlPatterns.QXmlNodeModelIndex

If this PySide.QtXmlPatterns.QXmlItem represents a node, it returns the item as a PySide.QtXmlPatterns.QXmlNodeModelIndex . If this PySide.QtXmlPatterns.QXmlItem is not a node, the return value is undefined. You can call PySide.QtXmlPatterns.QXmlItem.isNode() to test whether the item is a node.