Skip to content

PythonQt.QtXmlPatterns.QAbstractXmlNodeModel · declarations 001

Back to PythonQt.QtXmlPatterns.QAbstractXmlNodeModel

FirstChild instance-attribute

FirstChild: Any

InheritNamespaces instance-attribute

InheritNamespaces: Any

NextSibling instance-attribute

NextSibling: Any

NodeCopySetting instance-attribute

NodeCopySetting: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

Parent instance-attribute

Parent: Any

PreserveNamespaces instance-attribute

PreserveNamespaces: Any

PreviousSibling instance-attribute

PreviousSibling: Any

SimpleAxis instance-attribute

SimpleAxis: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

attributes

attributes(element: Any) -> tuple

X.attributes(element) -> tuple

Supplemental documentation: Qt 5 reference:

[pure virtual protected] QVector\<QXmlNodeModelIndex> QAbstractXmlNodeModel::attributes(const QXmlNodeModelIndex \&element) const

Returns the attributes of element. The caller guarantees that element is an element in this node model.

Upstream PySide2 reference signatures (binding differences may apply):

attributes(self, element: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> typing.List[PySide2.QtXmlPatterns.QXmlNodeModelIndex]

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#attributes

baseUri

baseUri(ni: Any) -> Any

X.baseUri(ni) -> PythonQt.QtCore.QUrl

Supplemental documentation: Qt 5 reference:

[pure virtual] QUrl QAbstractXmlNodeModel::baseUri(const QXmlNodeModelIndex \&n) const

Returns the base URI for the node whose index is n. The caller guarantees that n is not null and that it belongs to a node in this node model.

The base URI of a node can be extracted using the fn:base-uri() function. The base URI is typically used for resolving relative URIs that appear in the node or its children. It is conformant to just return the document URI, although that might not properly reflect the underlying data.

This function maps to the dm:base-uri accessor, which returns a base URI according to the following:

  • For document nodes, the base URI and the document URI are the same.
  • For elements, the base URI is the URI appearing in the element's xml:base attribute, if present, or it is resolved to the parent element's base URI.
  • Namespace nodes have no base URI.
  • The base URI for a processing instruction, comment, attribute, or text node is the base URI of the node's parent element.

The implementation guarantees to return a valid QUrl, or a default constructed QUrl. If a node has no base URI, as in the case where a comment has no parent, a default constructed QUrl is returned.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.2 base-uri Accessor.

Upstream PySide2 reference signatures (binding differences may apply):

baseUri(self, ni: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtCore.QUrl

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#baseUri

compareOrder

compareOrder(ni1: Any, ni2: Any) -> Any

X.compareOrder(ni1, ni2)

Supplemental documentation: Qt 5 reference:

[pure virtual] QXmlNodeModelIndex::DocumentOrder QAbstractXmlNodeModel::compareOrder(const QXmlNodeModelIndex \&ni1, const QXmlNodeModelIndex \&ni2) const

This function returns the relative document order for the nodes indexed by ni1 and ni2. It is used for the Is operator and for sorting nodes in document order.

The caller guarantees that ni1 and ni2 are not null and that both identify nodes in this node model.

If ni1 is identical to ni2, QXmlNodeModelIndex::Is is returned. If ni1 precedes ni2 in document order, QXmlNodeModelIndex::Precedes is returned. If ni1 follows ni2 in document order, QXmlNodeModelIndex::Follows is returned.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 2.4 Document Order.

Upstream PySide2 reference signatures (binding differences may apply):

compareOrder(self, ni1: PySide2.QtXmlPatterns.QXmlNodeModelIndex, ni2: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex.DocumentOrder

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#compareOrder

createIndex

createIndex(data: Any, additionalData: Any) -> Any

X.createIndex(data, additionalData) -> PythonQt.QtXmlPatterns.QXmlNodeModelIndex

Supplemental documentation: Qt 5 reference:

[protected] QXmlNodeModelIndex QAbstractXmlNodeModel::createIndex(qint64 data) const

Creates a node index with data as its internal data. data is not constrained.

[protected] QXmlNodeModelIndex QAbstractXmlNodeModel::createIndex(void *pointer, qint64 additionalData \= 0) const

Creates a node index with pointer and additionalData as its internal data.

What pointer and additionalData is, is not constrained.

[protected] QXmlNodeModelIndex QAbstractXmlNodeModel::createIndex(qint64 data, qint64 additionalData) const

This is an overloaded function.

Creates a QXmlNodeModelIndex containing data and additionalData.

Upstream PySide2 reference signatures (binding differences may apply):

createIndex(self, data: int) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex
createIndex(self, data: int, additionalData: int) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex
createIndex(self, pointer: int, additionalData: int=...) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#createIndex

documentUri

documentUri(ni: Any) -> Any

X.documentUri(ni) -> PythonQt.QtCore.QUrl

Supplemental documentation: Qt 5 reference:

[pure virtual] QUrl QAbstractXmlNodeModel::documentUri(const QXmlNodeModelIndex \&n) const

Returns the document URI of n. The document URI identifies the resource which is the document. For example, the document could be a regular file, e.g., file:/, or it could be the http:// URL of the location of a file. The document URI is used for resolving URIs and to simply know where the document is.

If the node model maps to a URI in a natural way, return that URI. Otherwise, return the company or product URI. The document URI can be any URI as long as its valid and absolute.

The caller guarantees that n is not null and that it belongs to this QAbstractXmlNodeModel.

This function maps to the dm:document-uri accessor, which returns a document URI according to the following:

  • If n is a document node, return an absolute QUrl containing the document URI, or a default constructed QUrl. The latter signals that no document URI is available for the document node.
  • For all other nodes, return a default constructed QUrl.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.4 document-uri Accessor, QUrl::isValid(), and QUrl::isRelative().

Upstream PySide2 reference signatures (binding differences may apply):

documentUri(self, ni: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtCore.QUrl

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#documentUri

elementById

elementById(NCName: Any) -> Any

X.elementById(NCName) -> PythonQt.QtXmlPatterns.QXmlNodeModelIndex

Supplemental documentation: Qt 5 reference:

[pure virtual] QXmlNodeModelIndex QAbstractXmlNodeModel::elementById(const QXmlName \&id) const

Returns the index of the element identified as id. XQuery's id() function calls this function.

The node index returned will be the element node whose value is of type ID and equals id, or it will be the element node that has an attribute whose typed value is of type ID and equals id. If there is no such element, a default constructed QXmlNodeModelIndex instance is returned. The implementor guarantees that if the returned node index is not null, it identifies an element.

It is not sufficient for an attribute or element to merely be called id. Its value type must also be ID. However, the reserved name xml:id is sufficient.

In id, the namespace URI and the prefix are undefined, and the local name is the ID that should be looked up.

See also XQuery 1.0 and XPath 2.0 Functions and Operators, 15.5.2 fn:id.

Upstream PySide2 reference signatures (binding differences may apply):

elementById(self, NCName: PySide2.QtXmlPatterns.QXmlName) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#elementById

isDeepEqual

isDeepEqual(ni1: Any, ni2: Any) -> bool

X.isDeepEqual(ni1, ni2) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isDeepEqual(self, ni1: PySide2.QtXmlPatterns.QXmlNodeModelIndex, ni2: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#isDeepEqual

kind

kind(ni: Any) -> Any

X.kind(ni)

Supplemental documentation: Qt 5 reference:

[pure virtual] QXmlNodeModelIndex::NodeKind QAbstractXmlNodeModel::kind(const QXmlNodeModelIndex \&ni) const

Returns a value indicating the kind of node identified by ni. The caller guarantees that ni is not null and that it identifies a node in this node model. This function maps to the dm:node-kind() accessor.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.10 node-kind Accessor.

Upstream PySide2 reference signatures (binding differences may apply):

kind(self, ni: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex.NodeKind

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#kind

name

name(ni: Any) -> Any

X.name(ni) -> PythonQt.QtXmlPatterns.QXmlName

Supplemental documentation: Qt 5 reference:

[pure virtual] QXmlName QAbstractXmlNodeModel::name(const QXmlNodeModelIndex \&ni) const

Returns the name of ni. The caller guarantees that ni is not null and that it belongs to this QAbstractXmlNodeModel.

If a node does not have a name, e.g., comment nodes, a null QXmlName is returned. QXmlNames must be created with the instance of QXmlQuery that is being used for evaluating queries using this QAbstractXmlNodeModel.

This function maps to the dm:node-name() accessor.

If ni is a processing instruction, a QXmlName is returned with the local name as the target name and the namespace URI and prefix both empty.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.11 node-name Accessor and QXmlName.

Upstream PySide2 reference signatures (binding differences may apply):

name(self, ni: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QXmlName

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#name

namespaceBindings

namespaceBindings(n: Any) -> tuple

X.namespaceBindings(n) -> tuple

Supplemental documentation: Qt 5 reference:

[pure virtual] QVector\<QXmlName> QAbstractXmlNodeModel::namespaceBindings(const QXmlNodeModelIndex \&n) const

Returns the in-scope namespaces of n. The caller guarantees that n is not null and that it belongs to this QAbstractXmlNodeModel.

This function corresponds to the dm:namespace-nodes accessor.

The returned vector of namespace declarations includes namespaces of the ancestors of n.

The caller guarantees that n is an Element that belongs to this QAbstractXmlNodeModel.

Upstream PySide2 reference signatures (binding differences may apply):

namespaceBindings(self, n: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> typing.List[PySide2.QtXmlPatterns.QXmlName]

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#namespaceBindings

namespaceForPrefix

namespaceForPrefix(ni: Any, prefix: Any) -> int

X.namespaceForPrefix(ni, prefix) -> int

Upstream PySide2 reference signatures (binding differences may apply):

namespaceForPrefix(self, ni: PySide2.QtXmlPatterns.QXmlNodeModelIndex, prefix: Missing('PySide2.QtXmlPatterns.QXmlName.PrefixCode')) -> Missing('PySide2.QtXmlPatterns.QXmlName.NamespaceCode')

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#namespaceForPrefix

nextFromSimpleAxis

nextFromSimpleAxis(axis: Any, origin: Any) -> Any

X.nextFromSimpleAxis(axis, origin) -> PythonQt.QtXmlPatterns.QXmlNodeModelIndex

Supplemental documentation: Qt 5 reference:

[pure virtual protected] QXmlNodeModelIndex QAbstractXmlNodeModel::nextFromSimpleAxis(QAbstractXmlNodeModel::SimpleAxis axis, const QXmlNodeModelIndex \&origin) const

When Qt XML Patterns evaluate path expressions, it emulate them through a combination of calls with QSimpleXmlNodeModel::SimpleAxis values. Therefore, the implementation of this function must return the node, if any, that appears on the axis emanating from the origin.

If no such node is available, a default constructed QXmlNodeModelIndex is returned.

QSimpleXmlNodeModel eliminates the need to handle redundant corner cases by guaranteeing that it will never ask for:

  • Children or siblings for attributes.
  • Children for comments, processing instructions, and text nodes.
  • Siblings or parents for document nodes.

A typical implementation performs a switch on the value of axis:

QXmlNodeModelIndex MyTreeModel::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &origin) const
{
  // Convert the QXmlNodeModelIndex to a value that is specific to what we represent.
  const MyValue value = toMyValue(ni);

  switch(axis)
  {
      case Parent:
          return toNodeIndex(value.parent());
      case FirstChild:
      case PreviousSibling:
      case NextSibling:
          // and so on
  }
}

Upstream PySide2 reference signatures (binding differences may apply):

nextFromSimpleAxis(self, axis: PySide2.QtXmlPatterns.QAbstractXmlNodeModel.SimpleAxis, origin: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#nextFromSimpleAxis

nodesByIdref

nodesByIdref(NCName: Any) -> tuple

X.nodesByIdref(NCName) -> tuple

Supplemental documentation: Qt 5 reference:

[pure virtual] QVector\<QXmlNodeModelIndex> QAbstractXmlNodeModel::nodesByIdref(const QXmlName \&idref) const

Returns the elements and/or attributes that have an IDREF value equal to idref. XQuery's idref() function calls this function.

The implementor guarantees that the nodes identified by the returned indexes are elements or attributes.

It is not sufficient for an attribute or element to merely be called idref. It must also be of type IDREF. Elements must be typed as xs:IDREF or xs:IDREFS, or, in the case of attributes, as IDREF or IDREFS in the schema.

In idref, the namespace URI and the prefix are undefined, and the local name is the ID that should be looked up.

See also XQuery 1.0 and XPath 2.0 Functions and Operators, 15.5.3 fn:idref.

Upstream PySide2 reference signatures (binding differences may apply):

nodesByIdref(self, NCName: PySide2.QtXmlPatterns.QXmlName) -> typing.List[PySide2.QtXmlPatterns.QXmlNodeModelIndex]

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#nodesByIdref

root

root(n: Any) -> Any

X.root(n) -> PythonQt.QtXmlPatterns.QXmlNodeModelIndex

Supplemental documentation: Qt 5 reference:

[pure virtual] QXmlNodeModelIndex QAbstractXmlNodeModel::root(const QXmlNodeModelIndex \&n) const

Returns the root node of the tree that contains the node whose index is n. The caller guarantees that n is not null and that it identifies a node in this node model.

If n identifies a node that is a direct child of the root, parent() would return the same QXmlNodeModelIndex returned by this function.

Upstream PySide2 reference signatures (binding differences may apply):

root(self, n: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QXmlNodeModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#root

sourceLocation

sourceLocation(index: Any) -> Any

X.sourceLocation(index) -> PythonQt.QtXmlPatterns.QSourceLocation

Supplemental documentation: Qt 5 reference:

QSourceLocation QAbstractXmlNodeModel::sourceLocation(const QXmlNodeModelIndex \&index) const

Returns the source location for the object with the given index or a default constructed QSourceLocation in case no location information is available.

This function was introduced in Qt 4.6.

Upstream PySide2 reference signatures (binding differences may apply):

sourceLocation(self, index: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> PySide2.QtXmlPatterns.QSourceLocation

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#sourceLocation

stringValue

stringValue(n: Any) -> str

X.stringValue(n) -> str

Supplemental documentation: Qt 5 reference:

[pure virtual] QString QAbstractXmlNodeModel::stringValue(const QXmlNodeModelIndex \&n) const

Returns the string value for node n.

The caller guarantees that n is not null and that it belong to this QAbstractXmlNodeModel instance.

This function maps to the dm:string-value() accessor, which the specification completely specifies. Here's a summary:

  • For processing instructions, the string value is the data section(excluding any whitespace appearing between the name and the data).
  • For text nodes, the string value equals the text node.
  • For comments, the content of the comment
  • For elements, the concatenation of all text nodes that are descendants. Note, this is not only the children, but the childrens' childrens' text nodes, and so forth.
  • For document nodes, the concatenation of all text nodes in the document.

See also XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.13 string-value Accessor.

Upstream PySide2 reference signatures (binding differences may apply):

stringValue(self, n: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> str

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#stringValue

typedValue

typedValue(n: Any) -> Any

X.typedValue(n) -> object

Supplemental documentation: Qt 5 reference:

[pure virtual] QVariant QAbstractXmlNodeModel::typedValue(const QXmlNodeModelIndex \&node) const

Returns the typed value for node node.

The typed value is an atomic value, which an element or attribute contains.

The caller guarantees that node is either an element or an attribute. The implementor guarantees that the returned QVariant has a value which is supported in XQuery. It cannot be an arbitrary QVariant value. The implementor also guarantees that stringValue() returns a lexical representation of typedValue() (this is guaranteed by QSimpleXmlNodeModel::stringValue()).

If the return QVariant is a default constructed variant, it signals that node has no typed value.

Upstream PySide2 reference signatures (binding differences may apply):

typedValue(self, n: PySide2.QtXmlPatterns.QXmlNodeModelIndex) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qabstractxmlnodemodel.html#typedValue