Qt 4.8
|
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML for QXmlQuery. More...
#include <qabstractxmlnodemodel.h>
Public Types | |
typedef QList< Ptr > | List |
A list of smart pointers to instances of QAbstractXmlNodeModel. More... | |
enum | NodeCopySetting { InheritNamespaces = 0x1, PreserveNamespaces = 0x2 } |
typedef QFlags< NodeCopySetting > | NodeCopySettings |
typedef QExplicitlySharedDataPointer< QAbstractXmlNodeModel > | Ptr |
A QExplicitlySharedDataPointer {smart pointer} to an instance of QAbstractXmlNodeModel. More... | |
enum | SimpleAxis { Parent, FirstChild, PreviousSibling, NextSibling } |
Four axes that each contain one node only. More... | |
Public Functions | |
virtual QUrl | baseUri (const QXmlNodeModelIndex &ni) const =0 |
Returns the base URI for the node whose index is n. More... | |
virtual QXmlNodeModelIndex::DocumentOrder | compareOrder (const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const =0 |
This function returns the relative document order for the nodes indexed by ni1 and ni2. More... | |
virtual void | copyNodeTo (const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &) const |
virtual QUrl | documentUri (const QXmlNodeModelIndex &ni) const =0 |
Returns the document URI of n. More... | |
virtual QXmlNodeModelIndex | elementById (const QXmlName &NCName) const =0 |
Returns the index of the element identified as id. More... | |
virtual bool | isDeepEqual (const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const |
Determines whether ni1 is deep equal to ni2. More... | |
virtual QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QXmlNodeModelIndex > > | iterate (const QXmlNodeModelIndex &ni, QXmlNodeModelIndex::Axis axis) const |
Performs navigation, starting from ni, by returning an QAbstractXmlForwardIterator that returns nodes the axis emanating from ni. More... | |
virtual QXmlNodeModelIndex::NodeKind | kind (const QXmlNodeModelIndex &ni) const =0 |
Returns a value indicating the kind of node identified by ni. More... | |
virtual QXmlName | name (const QXmlNodeModelIndex &ni) const =0 |
Returns the name of ni. More... | |
virtual QVector< QXmlName > | namespaceBindings (const QXmlNodeModelIndex &n) const =0 |
Returns the in-scope namespaces of n. More... | |
virtual QXmlName::NamespaceCode | namespaceForPrefix (const QXmlNodeModelIndex &ni, const QXmlName::PrefixCode prefix) const |
Returns the namespace URI on ni that corresponds to prefix. More... | |
virtual QVector< QXmlNodeModelIndex > | nodesByIdref (const QXmlName &NCName) const =0 |
Returns the elements and/or attributes that have an IDREF value equal to idref. More... | |
QAbstractXmlNodeModel () | |
Default constructor. More... | |
virtual QXmlNodeModelIndex | root (const QXmlNodeModelIndex &n) const =0 |
Returns the root node of the tree that contains the node whose index is n. More... | |
virtual void | sendNamespaces (const QXmlNodeModelIndex &n, QAbstractXmlReceiver *const receiver) const |
Sends the namespaces declared on n to receiver. More... | |
virtual QPatternist::ItemIteratorPtr | sequencedTypedValue (const QXmlNodeModelIndex &ni) const |
QSourceLocation | 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. More... | |
virtual QString | stringValue (const QXmlNodeModelIndex &n) const =0 |
Returns the string value for node n. More... | |
virtual QPatternist::ItemTypePtr | type (const QXmlNodeModelIndex &ni) const |
virtual QVariant | typedValue (const QXmlNodeModelIndex &n) const =0 |
Returns the typed value for node node. More... | |
virtual | ~QAbstractXmlNodeModel () |
Destructor. More... | |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Protected Functions | |
virtual QVector< QXmlNodeModelIndex > | attributes (const QXmlNodeModelIndex &element) const =0 |
Returns the attributes of element. More... | |
QXmlNodeModelIndex | createIndex (qint64 data) const |
Creates a node index with data as its internal data. More... | |
QXmlNodeModelIndex | createIndex (void *pointer, qint64 additionalData=0) const |
Creates a node index with pointer and additionalData as its internal data. More... | |
QXmlNodeModelIndex | createIndex (qint64 data, qint64 additionalData) const |
Creates a QXmlNodeModelIndex containing data and additionalData. More... | |
virtual QXmlNodeModelIndex | nextFromSimpleAxis (SimpleAxis axis, const QXmlNodeModelIndex &origin) const =0 |
When QtXmlPatterns evaluate path expressions, it emulate them through a combination of calls with QSimpleXmlNodeModel::SimpleAxis values. More... | |
QAbstractXmlNodeModel (QAbstractXmlNodeModelPrivate *d) | |
Protected Variables | |
QScopedPointer< QAbstractXmlNodeModelPrivate > | d_ptr |
Private Functions | |
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QXmlNodeModelIndex > > | mapToSequence (const QXmlNodeModelIndex &ni, const QExplicitlySharedDataPointer< QPatternist::DynamicContext > &) const |
Static Private Functions | |
static bool | isIgnorableInDeepEqual (const QXmlNodeModelIndex &n) |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML for QXmlQuery.
The QAbstractXmlNodeModel specifies the interface that a node model must implement for that node model be accessible to the query engine for processing XQuery queries. A node model represents data as a structure that can be queried as if the data were XML.
The node model represented by a subclass of QAbstractXmlNodeModel is meant to be accessed by the QtXmlPatterns query engine. If the API seems a little strange in a few places, it is because the member functions are called by the query engine as it evaluates an XQuery. They aren't meant to be used programatically.
QAbstractXmlNodeModel bridges the gap between the arbitrary structure of the non-XML data to be queried and the well-defined structure of XML data understood by QXmlQuery.
Consider a chemistry application that reads the file chemistryData
, which contains non-XML data that represents a chemical structure composed of molecules and atoms. The application will query this chemistry data with an XQuery it reads from file queryFile
. We write a custom subclass of QAbstractXmlNodeModel (ChemistryNodeModel
) that reads chemistryData
and builds a data structure, perhaps composed of objects of our own classes molecule
and atom
. Clearly, this data structure is not XML. Our custom subclass will know how to traverse this non-XML structure and present it through the http://www.w3.org/TR/xpath-datamodel/ {XPath Data Model interface}.
The application first creates an instance of QXmlQuery and calls QXmlQuery::setQuery() to read queryFile
containing the XQuery we want to run. Then it creates an instance of our custom node model class, ChemistryNodeModel
, which is a subclass of QAbstractXmlNodeModel. Its constructor is called with the QXmlNamePool {name pool} obtained from our QXmlQuery, and with the chemistryFile
containing the structure of molecules and atoms to be queried. The QXmlNamePool {name pool} is required because our custom node model has the member function QAbstractXmlNodeModel::name() {name()}, which returns the QXmlName {name} of any node in the model. The QXmlQuery {query} and the custom node model must use the same name pool for constructing these QXmlName {names}. The constructor would then read chemistryFile
and build the custom node model structure.
To connect the query
to the custom node model, we must bind a variable name used in the query to a node in the model. The variable can then be used in the query as a starting node. First, an QXmlNodeModelIndex {index} for the desired starting node is retrieved by calling QAbstractXmlNodeModel::createIndex(). Then the index is bound to a variable name, in this case queryRoot
, by passing the name and the index to QXmlQuery::bindVariable(). The query can then use a variable reference $queryRoot
to refer to the starting node. Note that if the QXmlQuery {query} uses multiple variable references, a call to QXmlQuery::bindVariable() is required to bind each different variable name to a node in the model.
The query is executed when the application calls one of the QXmlQuery evaluation functions. The application uses QXmlQuery::evaluateTo(QAbstractXmlReceiver *), because it then uses a QXmlSerializer {serializer} to out the query result as XML to stdout
. We could have used QXmlQuery::evaluateTo(QXmlResultItems ) to get a list of result items, or QXmlQuery::evaluateTo(QStringList *) if the query evaluated to a sequence of {xs:string}
values.
During query execution, the engine iterates over the node model using nextFromSimpleAxis() to get the QXmlNodeModelIndex {index} of the next node to be visited. The engine can get the name of a node by calling name() with the node's QXmlNodeModelIndex {index}. stringValue(), baseUri(), documentUri() and kind() are also called as needed with a node QXmlNodeModelIndex {index}.
The example demonstrates the standard pattern for using a subclass of QAbstractXmlNodeModel in combination with QXmlQuery to perform an XQuery.
Instantiate QXmlQuery and give it the XQuery to be run;
Instantiate a subclass of QAbstractXmlNodeModel or QSimpleXmlNodeModel;
Retrieve a QXmlNodeModelIndex for the node in the model where the QXmlQuery should start the query;
Use QXmlQuery::bindVariable() to bind the QXmlNodeModelIndex to {$variable
name};
Call one of the QXmlQuery evaluation functions to run the query.
Because the http://www.w3.org/TR/xpath-datamodel/ {XPath Data Model interface} presented by QAbstractXmlNodeModel allows QXmlQuery to operate on non-XML data as if it were XML, implementing subclasses of QAbstractXmlNodeModel can involve a significant amount of work. The QSimpleXmlNodeModel class is provided to simplify the implementation for many common use cases.
Because the node model can be accessed concurrently by threads in the QtXmlPatterns module, subclasses of QAbstractXmlNodeModel must be written to be Reentrancy and Thread-Safety{thread-safe}. Classes that simplify implementing thread-safety include QReadLocker and QWriteLocker.
See the example File System Example for a demonstration.
Definition at line 271 of file qabstractxmlnodemodel.h.
A list of smart pointers to instances of QAbstractXmlNodeModel.
Definition at line 283 of file qabstractxmlnodemodel.h.
Definition at line 321 of file qabstractxmlnodemodel.h.
A QExplicitlySharedDataPointer {smart pointer} to an instance of QAbstractXmlNodeModel.
Definition at line 282 of file qabstractxmlnodemodel.h.
Controls how nodes are copied with copyNodeTo.
copy-namespaces
setting being inherit
. If not set, no-inherit
is assumed. copy-namespaces
settings being preserve
. If not set, no-preserve
is assumed. Enumerator | |
---|---|
InheritNamespaces | |
PreserveNamespaces |
Definition at line 315 of file qabstractxmlnodemodel.h.
Four axes that each contain one node only.
Enumerator | |
---|---|
Parent | |
FirstChild | |
PreviousSibling | |
NextSibling |
Definition at line 274 of file qabstractxmlnodemodel.h.
QAbstractXmlNodeModel::QAbstractXmlNodeModel | ( | ) |
Default constructor.
Definition at line 291 of file qabstractxmlnodemodel.cpp.
|
virtual |
|
protected |
Takes the d-pointer.
Definition at line 301 of file qabstractxmlnodemodel.cpp.
|
protectedpure virtual |
Returns the attributes of element.
The caller guarantees that element is an element in this node model.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::attributes(), and iterate().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, QPatternist::XsdValidatedXmlNodeModel, and QSimpleXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::baseUri().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::compareOrder().
|
virtual |
Copies node node to receiver, steered by copySettings.
The caller guarantees that node is not null
, and that is belongs to this QAbstractXmlNodeModel instance.
The caller guarantees that receiver is not null
.
Definition at line 1724 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::copyNodeTo(), and QPatternist::CopyOf::evaluateToSequenceReceiver().
|
inlineprotected |
Creates a node index with data as its internal data.
data is not constrained.
Definition at line 335 of file qabstractxmlnodemodel.h.
Referenced by QPatternist::AccelTree::elementById(), QPatternist::AccelTree::iterate(), QPatternist::AncestorIterator< IncludeSelf >::next(), QPatternist::ChildIterator::next(), QPatternist::SiblingIterator< IsFollowing >::next(), QPatternist::DescendantIterator< IncludeSelf >::next(), QPatternist::FollowingIterator::next(), QPatternist::PrecedingIterator::next(), QPatternist::AttributeIterator::next(), QPatternist::AccelTree::parent(), and QPatternist::AccelTree::root().
|
inlineprotected |
Creates a node index with pointer and additionalData as its internal data.
What pointer and additionalData is, is not constrained.
Definition at line 340 of file qabstractxmlnodemodel.h.
|
inlineprotected |
Creates a QXmlNodeModelIndex containing data and additionalData.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 346 of file qabstractxmlnodemodel.h.
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by QSimpleXmlNodeModel::baseUri(), and QPatternist::XsdValidatedXmlNodeModel::documentUri().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, QPatternist::XsdValidatedXmlNodeModel, and QSimpleXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::elementById().
|
virtual |
Determines whether ni1 is deep equal to ni2.
isDeepEqual() is defined as evaluating the expression fn:deep-equal
($n1, $n2) where $n1
is ni1 and $n1
is ni2. This function is associative, meaning the same value is returned regardless of if isDeepEqual() is invoked with ni1 as first argument or second. It is guaranteed that ni1 and ni2 are nodes, as opposed to the definition of fn:deep-equal
().
Returns true if ni1 is deep-equal to ni2, otherwise false
Reimplemented in QPatternist::XsdValidatedXmlNodeModel.
Definition at line 1071 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::isDeepEqual().
|
inlinestaticprivate |
Definition at line 67 of file qabstractxmlnodemodel.cpp.
Referenced by isDeepEqual().
|
virtual |
Performs navigation, starting from ni, by returning an QAbstractXmlForwardIterator that returns nodes the axis emanating from ni.
The implementation returns the nodes on the axis, without duplicates and in axis order. This means that if axis is a reverse axis, which is the case for the parent
, ancestor
, ancestor-or-self
, preceding
, and preceding-sibling
, the nodes are delivered in reverse document order. Otherwise the nodes are delivered in document order.
The implementor guarantees that the nodes delivered for the axes are consistent with the XPath Data Model. This just implies common sense, e.g., The child axis for a comment node can't contain any children; a document node can't be a child of an element, etc. Attributes aren't considered children of an element, but are only available on AxisAttribute.
The value past in axis is not guaranteed based on what is used in a query. QtXmlPatterns may call this function arbitrarily with any value for axis. This is because QtXmlPatterns may rewrite queries to be more efficient, using axes in different ways from the original query.
QAbstractXmlNodeModel::Axis has a good overview of the axes and what they select.
The caller guarantees that ni is not null
and that it belongs to this QAbstractXmlNodeModel instance.
Implementing iterate() can involve significant work, since it requires different iterators for all the axes used. In the worst case, it could require writing as many QAbstractXmlForwardIterator subclasses as there are axes, but the number can often be reduced with clever use of lists and template classes. It is better to use or subclass QSimpleXmlNodeModel, which makes it easier to write the node navigation code without loss of efficiency or flexibility.
Reimplemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Definition at line 616 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdInstanceReader::hasChildElement(), QPatternist::XsdInstanceReader::hasChildText(), QPatternist::XsdValidatedXmlNodeModel::iterate(), and QPatternist::XsdInstanceReader::text().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by iterate(), QPatternist::XsdValidatedXmlNodeModel::kind(), namespaceForPrefix(), and QSimpleXmlNodeModel::stringValue().
|
inlineprivate |
Definition at line 546 of file qabstractxmlnodemodel.cpp.
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::name().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, QPatternist::XsdValidatedXmlNodeModel, and QSimpleXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::namespaceBindings(), namespaceForPrefix(), and sendNamespaces().
|
virtual |
Returns the namespace URI on ni that corresponds to prefix.
If prefix is StandardPrefixes::empty, the namespace URI for the default namespace is returned.
The default implementation use namespaceBindings(), in a straight forward manner.
If no namespace exists for prefix, NamespaceResolver::NoBinding is returned.
The caller guarantees to only call this function for element nodes.
Reimplemented in QPatternist::XsdValidatedXmlNodeModel.
Definition at line 1034 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::namespaceForPrefix().
|
protectedpure virtual |
When QtXmlPatterns 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:
A typical implementation performs a switch
on the value of axis:
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by iterate(), and QPatternist::XsdValidatedXmlNodeModel::nextFromSimpleAxis().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, QPatternist::XsdValidatedXmlNodeModel, and QSimpleXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::nodesByIdref().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::root(), and QXmlNodeModelIndex::root().
|
virtual |
Sends the namespaces declared on n to receiver.
As a consequence, no namespaces are sent unless this node is an element and has namespaces declared.
The caller guarantees that n is not null
and that it belongs to this QAbstractXmlNodeModel instance.
Note that it is not the namespaces that are in scope on n, but only the namespaces that are specifically declared on n.
receiver is the receiver that this node is supposed to send its namespaces to. This is guaranteed by the caller to be a valid pointer. n is the index of the node whose namespaces are to be sent.
Definition at line 920 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::sendNamespaces().
|
virtual |
Reimplemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Definition at line 996 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::sequencedTypedValue().
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.
Definition at line 1742 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::PullBridge::sourceLocation().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, QPatternist::XsdValidatedXmlNodeModel, and QSimpleXmlNodeModel.
Referenced by QPatternist::XsdValidatedXmlNodeModel::stringValue().
|
virtual |
Reimplemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Definition at line 1008 of file qabstractxmlnodemodel.cpp.
Referenced by QPatternist::XsdValidatedXmlNodeModel::type().
|
pure virtual |
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.
Implemented in QPatternist::AccelTree, and QPatternist::XsdValidatedXmlNodeModel.
Referenced by sequencedTypedValue(), QSimpleXmlNodeModel::stringValue(), and QPatternist::XsdValidatedXmlNodeModel::typedValue().
|
friend |
Definition at line 354 of file qabstractxmlnodemodel.h.
|
friend |
Definition at line 355 of file qabstractxmlnodemodel.h.
|
friend |
Definition at line 356 of file qabstractxmlnodemodel.h.
|
protected |
Definition at line 352 of file qabstractxmlnodemodel.h.