Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4833

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qabstractxmlnodemodel.cpp -->
  <title>Qt 4.8: QAbstractXmlNodeModel Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtxmlpatterns.html">QtXmlPatterns</a></li>
<li>QAbstractXmlNodeModel</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#usage">Usage</a></li>
<li class="level2"><a href="#subclassing">Subclassing</a></li>
<li class="level2"><a href="#thread-safety">Thread Safety</a></li>
</ul>
</div>
<h1 class="title">QAbstractXmlNodeModel Class Reference</h1>
<!-- $$$QAbstractXmlNodeModel-brief -->
<p>The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML for <a href="qxmlquery.html">QXmlQuery</a>. <a href="#details">More...</a></p>
<!-- @@@QAbstractXmlNodeModel -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAbstractXmlNodeModel&gt;</span></pre><p><b>Inherits: </b><a href="qshareddata.html">QSharedData</a>.</p>
<p><b>Inherited by: </b><a href="qsimplexmlnodemodel.html">QSimpleXmlNodeModel</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#thread-safe">thread-safe</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qabstractxmlnodemodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#List-typedef">List</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#Ptr-typedef">Ptr</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#SimpleAxis-enum">SimpleAxis</a></b> { Parent, FirstChild, PreviousSibling, NextSibling }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#QAbstractXmlNodeModel">QAbstractXmlNodeModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#dtor.QAbstractXmlNodeModel">~QAbstractXmlNodeModel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUrl </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#baseUri">baseUri</a></b> ( const QXmlNodeModelIndex &amp; <i>n</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlNodeModelIndex::DocumentOrder </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#compareOrder">compareOrder</a></b> ( const QXmlNodeModelIndex &amp; <i>ni1</i>, const QXmlNodeModelIndex &amp; <i>ni2</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QUrl </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#documentUri">documentUri</a></b> ( const QXmlNodeModelIndex &amp; <i>n</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#elementById">elementById</a></b> ( const QXmlName &amp; <i>id</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlNodeModelIndex::NodeKind </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#kind">kind</a></b> ( const QXmlNodeModelIndex &amp; <i>ni</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlName </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#name">name</a></b> ( const QXmlNodeModelIndex &amp; <i>ni</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVector&lt;QXmlName&gt; </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#namespaceBindings">namespaceBindings</a></b> ( const QXmlNodeModelIndex &amp; <i>n</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVector&lt;QXmlNodeModelIndex&gt; </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#nodesByIdref">nodesByIdref</a></b> ( const QXmlName &amp; <i>idref</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#root">root</a></b> ( const QXmlNodeModelIndex &amp; <i>n</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSourceLocation </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#sourceLocation">sourceLocation</a></b> ( const QXmlNodeModelIndex &amp; <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#stringValue">stringValue</a></b> ( const QXmlNodeModelIndex &amp; <i>n</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#typedValue">typedValue</a></b> ( const QXmlNodeModelIndex &amp; <i>node</i> ) const = 0</td></tr>
</table>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVector&lt;QXmlNodeModelIndex&gt; </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#attributes">attributes</a></b> ( const QXmlNodeModelIndex &amp; <i>element</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#createIndex">createIndex</a></b> ( qint64 <i>data</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#createIndex-2">createIndex</a></b> ( void * <i>pointer</i>, qint64 <i>additionalData</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#createIndex-3">createIndex</a></b> ( qint64 <i>data</i>, qint64 <i>additionalData</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QXmlNodeModelIndex </td><td class="memItemRight bottomAlign"><b><a href="qabstractxmlnodemodel.html#nextFromSimpleAxis">nextFromSimpleAxis</a></b> ( SimpleAxis <i>axis</i>, const QXmlNodeModelIndex &amp; <i>origin</i> ) const = 0</td></tr>
</table>
<a name="details"></a>
<!-- $$$QAbstractXmlNodeModel-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML for <a href="qxmlquery.html">QXmlQuery</a>.</p>
<p>The QAbstractXmlNodeModel specifies the interface that a node model must implement for that node model be accessible to the query engine for processing <a href="xmlprocessing.html">XQuery</a> queries. A node model represents data as a structure that can be queried as if the data were XML.</p>
<p>The node model represented by a subclass of QAbstractXmlNodeModel is meant to be accessed by the <a href="qtxmlpatterns.html">QtXmlPatterns</a> 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 <a href="xmlprocessing.html">XQuery</a>. They aren't meant to be used programatically.</p>
<a name="usage"></a>
<h3>Usage</h3>
<p>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 <a href="qxmlquery.html">QXmlQuery</a>.</p>
<p>Consider a chemistry application that reads the file <tt>chemistryData</tt>, which contains non-XML data that represents a chemical structure composed of molecules and atoms. The application will query this chemistry data with an <a href="xmlprocessing.html">XQuery</a> it reads from file <tt>queryFile</tt>. We write a custom subclass of QAbstractXmlNodeModel (<tt>ChemistryNodeModel</tt>) that reads <tt>chemistryData</tt> and builds a data structure, perhaps composed of objects of our own classes <tt>molecule</tt> and <tt>atom</tt>. Clearly, this data structure is not XML. Our custom subclass will know how to traverse this non-XML structure and present it through the <a href="http://www.w3.org/TR/xpath-datamodel/">XPath Data Model interface</a>.</p>
<pre class="cpp"> <span class="type"><a href="qfile.html">QFile</a></span> queryFile(argv<span class="operator">[</span><span class="number">1</span><span class="operator">]</span>);
 <span class="type"><a href="qfile.html">QFile</a></span> chemistryData(argv<span class="operator">[</span><span class="number">2</span><span class="operator">]</span>);
 <span class="type"><a href="qstring.html">QString</a></span> moleculeName <span class="operator">=</span> argv<span class="operator">[</span><span class="number">3</span><span class="operator">]</span>;

 <span class="type"><a href="qxmlquery.html">QXmlQuery</a></span> query;
 query<span class="operator">.</span>setQuery(<span class="operator">&amp;</span>queryFile<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(queryFile<span class="operator">.</span>fileName()));

 ChemistryNodeModel myNodeModel(query<span class="operator">.</span>namePool()<span class="operator">,</span> chemistryData);
 <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> startNode <span class="operator">=</span> myNodeModel<span class="operator">.</span>nodeFor(moleculeName);
 query<span class="operator">.</span>bindVariable(<span class="string">&quot;queryRoot&quot;</span><span class="operator">,</span> startNode);

 <span class="type"><a href="qfile.html">QFile</a></span> out;
 out<span class="operator">.</span>open(stdout<span class="operator">,</span> <span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>WriteOnly);

 <span class="type"><a href="qxmlserializer.html">QXmlSerializer</a></span> serializer(query<span class="operator">,</span> <span class="operator">&amp;</span>out);
 query<span class="operator">.</span>evaluateTo(<span class="operator">&amp;</span>serializer);</pre>
<p>The application first creates an instance of <a href="qxmlquery.html">QXmlQuery</a> and calls <a href="qxmlquery.html#setQuery">setQuery()</a> to read <tt>queryFile</tt> containing the <a href="xmlprocessing.html">XQuery</a> we want to run. Then it creates an instance of our custom node model class, <tt>ChemistryNodeModel</tt>, which is a subclass of QAbstractXmlNodeModel. Its constructor is called with the <a href="qxmlnamepool.html">name pool</a> obtained from our <a href="qxmlquery.html">QXmlQuery</a>, and with the <tt>chemistryFile</tt> containing the structure of molecules and atoms to be queried. The <a href="qxmlnamepool.html">name pool</a> is required because our custom node model has the member function <a href="qabstractxmlnodemodel.html#name">name()</a>, which returns the <a href="qxmlname.html">name</a> of any node in the model. The <a href="qxmlquery.html">query</a> and the custom node model must use the same name pool for constructing these <a href="qxmlname.html">names</a>. The constructor would then read <tt>chemistryFile</tt> and build the custom node model structure.</p>
<p>To connect the <tt>query</tt> 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 <a href="qxmlnodemodelindex.html">index</a> for the desired starting node is retrieved by calling <a href="qabstractxmlnodemodel.html#createIndex">QAbstractXmlNodeModel::createIndex</a>(). Then the index is bound to a variable name, in this case <tt>queryRoot</tt>, by passing the name and the index to <a href="qxmlquery.html#bindVariable">QXmlQuery::bindVariable</a>(). The query can then use a variable reference <tt>$queryRoot</tt> to refer to the starting node. Note that if the <a href="qxmlquery.html">query</a> uses multiple variable references, a call to <a href="qxmlquery.html#bindVariable">QXmlQuery::bindVariable</a>() is required to bind each different variable name to a node in the model.</p>
<p>The query is executed when the application calls one of the <a href="qxmlquery.html">QXmlQuery</a> evaluation functions. The application uses QXmlQuery::evaluateTo(<a href="qabstractxmlreceiver.html">QAbstractXmlReceiver</a> *), because it then uses a <a href="qxmlserializer.html">serializer</a> to out the query result as XML to <tt>stdout</tt>. We could have used QXmlQuery::evaluateTo(<a href="qxmlresultitems.html">QXmlResultItems</a> *) to get a list of result items, or QXmlQuery::evaluateTo(<a href="qstringlist.html">QStringList</a> *) if the query evaluated to a sequence of <tt>xs:string</tt> values.</p>
<p>During query execution, the engine iterates over the node model using <a href="qabstractxmlnodemodel.html#nextFromSimpleAxis">nextFromSimpleAxis</a>() to get the <a href="qxmlnodemodelindex.html">index</a> of the next node to be visited. The engine can get the name of a node by calling <a href="qabstractxmlnodemodel.html#name">name</a>() with the node's <a href="qxmlnodemodelindex.html">index</a>. <a href="qabstractxmlnodemodel.html#stringValue">stringValue</a>(), <a href="qabstractxmlnodemodel.html#baseUri">baseUri</a>(), <a href="qabstractxmlnodemodel.html#documentUri">documentUri</a>() and <a href="qabstractxmlnodemodel.html#kind">kind</a>() are also called as needed with a node <a href="qxmlnodemodelindex.html">index</a>.</p>
<p>The example demonstrates the standard pattern for using a subclass of QAbstractXmlNodeModel in combination with <a href="qxmlquery.html">QXmlQuery</a> to perform an <a href="xmlprocessing.html">XQuery</a>.</p>
<ol class="1">
<li>Instantiate <a href="qxmlquery.html">QXmlQuery</a> and give it the <a href="xmlprocessing.html">XQuery</a> to be run;</li>
<li>Instantiate a subclass of QAbstractXmlNodeModel or <a href="qsimplexmlnodemodel.html">QSimpleXmlNodeModel</a>;</li>
<li>Retrieve a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> for the node in the model where the <a href="qxmlquery.html">QXmlQuery</a> should start the query;</li>
<li>Use <a href="qxmlquery.html#bindVariable">QXmlQuery::bindVariable</a>() to bind the <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> to <tt>$variable name</tt>;</li>
<li>Call one of the <a href="qxmlquery.html">QXmlQuery</a> evaluation functions to run the query.</li>
</ol>
<a name="subclassing"></a>
<h3>Subclassing</h3>
<p>Because the <a href="http://www.w3.org/TR/xpath-datamodel/">XPath Data Model interface</a> presented by QAbstractXmlNodeModel allows <a href="qxmlquery.html">QXmlQuery</a> to operate on non-XML data as if it were XML, implementing subclasses of QAbstractXmlNodeModel can involve a significant amount of work. The <a href="qsimplexmlnodemodel.html">QSimpleXmlNodeModel</a> class is provided to simplify the implementation for many common use cases.</p>
<a name="thread-safety"></a>
<h3>Thread Safety</h3>
<p>Because the node model can be accessed concurrently by threads in the <a href="qtxmlpatterns.html">QtXmlPatterns</a> module, subclasses of QAbstractXmlNodeModel must be written to be <a href="threads-reentrancy.html">thread-safe</a>. Classes that simplify implementing thread-safety include <a href="qreadlocker.html">QReadLocker</a> and <a href="qwritelocker.html">QWriteLocker</a>.</p>
<p>See the example <a href="xmlpatterns-filetree.html">File System Example</a> for a demonstration.</p>
</div>
<!-- @@@QAbstractXmlNodeModel -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$List -->
<h3 class="fn"><a name="List-typedef"></a>typedef QAbstractXmlNodeModel::<span class="name">List</span></h3>
<p>A <a href="qlist.html">list</a> of <a href="qexplicitlyshareddatapointer.html">smart pointers</a> to instances of <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p><b>See also </b><a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a>.</p>
<!-- @@@List -->
<!-- $$$Ptr -->
<h3 class="fn"><a name="Ptr-typedef"></a>typedef QAbstractXmlNodeModel::<span class="name">Ptr</span></h3>
<p>A <a href="qexplicitlyshareddatapointer.html">smart pointer</a> to an instance of <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p><b>See also </b><a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a>.</p>
<!-- @@@Ptr -->
<!-- $$$SimpleAxis$$$Parent$$$FirstChild$$$PreviousSibling$$$NextSibling -->
<h3 class="fn"><a name="SimpleAxis-enum"></a>enum QAbstractXmlNodeModel::<span class="name">SimpleAxis</span></h3>
<p>Four axes that each contain one node only.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QAbstractXmlNodeModel::Parent</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The parent of the context node</td></tr>
<tr><td class="topAlign"><tt>QAbstractXmlNodeModel::FirstChild</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The first child of the context node</td></tr>
<tr><td class="topAlign"><tt>QAbstractXmlNodeModel::PreviousSibling</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The previous child of the context node</td></tr>
<tr><td class="topAlign"><tt>QAbstractXmlNodeModel::NextSibling</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The next child of the context node</td></tr>
</table>
<!-- @@@SimpleAxis -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAbstractXmlNodeModel[overload1]$$$QAbstractXmlNodeModel -->
<h3 class="fn"><a name="QAbstractXmlNodeModel"></a>QAbstractXmlNodeModel::<span class="name">QAbstractXmlNodeModel</span> ()</h3>
<p>Default constructor.</p>
<!-- @@@QAbstractXmlNodeModel -->
<!-- $$$~QAbstractXmlNodeModel[overload1]$$$~QAbstractXmlNodeModel -->
<h3 class="fn"><a name="dtor.QAbstractXmlNodeModel"></a>QAbstractXmlNodeModel::<span class="name">~QAbstractXmlNodeModel</span> ()<tt> [virtual]</tt></h3>
<p>Destructor.</p>
<!-- @@@~QAbstractXmlNodeModel -->
<!-- $$$attributes[overload1]$$$attributesconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="attributes"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span>&gt; QAbstractXmlNodeModel::<span class="name">attributes</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>element</i> ) const<tt> [pure virtual protected]</tt></h3>
<p>Returns the attributes of <i>element</i>. The caller guarantees that <i>element</i> is an element in this node model.</p>
<!-- @@@attributes -->
<!-- $$$baseUri[overload1]$$$baseUriconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="baseUri"></a><span class="type"><a href="qurl.html">QUrl</a></span> QAbstractXmlNodeModel::<span class="name">baseUri</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>n</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the base URI for the node whose index is <i>n</i>. The caller guarantees that <i>n</i> is not <tt>null</tt> and that it belongs to a node in this node model.</p>
<p>The base URI of a node can be extracted using the <tt>fn:base-uri()</tt> 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.</p>
<p>This function maps to the <tt>dm:base-uri</tt> accessor, which returns a base URI according to the following:</p>
<ul>
<li>For document nodes, the base URI and the document URI are the same.</li>
<li>For elements, the base URI is the URI appearing in the element's <tt>xml:base</tt> attribute, if present, or it is resolved to the parent element's base URI.</li>
<li>Namespace nodes have no base URI.</li>
<li>The base URI for a processing instruction, comment, attribute, or text node is the base URI of the node's parent element.</li>
</ul>
<p>The implementation guarantees to return a valid <a href="qurl.html">QUrl</a>, or a default constructed <a href="qurl.html">QUrl</a>. If a node has no base URI, as in the case where a comment has no parent, a default constructed <a href="qurl.html">QUrl</a> is returned.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#dm-base-uri">XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.2 base-uri Accessor</a>.</p>
<!-- @@@baseUri -->
<!-- $$$compareOrder[overload1]$$$compareOrderconstQXmlNodeModelIndex&constQXmlNodeModelIndex& -->
<h3 class="fn"><a name="compareOrder"></a><span class="type"><a href="qxmlnodemodelindex.html#DocumentOrder-enum">QXmlNodeModelIndex::DocumentOrder</a></span> QAbstractXmlNodeModel::<span class="name">compareOrder</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>ni1</i>, const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>ni2</i> ) const<tt> [pure virtual]</tt></h3>
<p>This function returns the relative document order for the nodes indexed by <i>ni1</i> and <i>ni2</i>. It is used for the <tt>Is</tt> operator and for sorting nodes in document order.</p>
<p>The caller guarantees that <i>ni1</i> and <i>ni2</i> are not <tt>null</tt> and that both identify nodes in this node model.</p>
<p>If <i>ni1</i> is identical to <i>ni2</i>, <a href="qxmlnodemodelindex.html#DocumentOrder-enum">QXmlNodeModelIndex::Is</a> is returned. If <i>ni1</i> precedes <i>ni2</i> in document order, <a href="qxmlnodemodelindex.html#DocumentOrder-enum">QXmlNodeModelIndex::Precedes</a> is returned. If <i>ni1</i> follows <i>ni2</i> in document order, <a href="qxmlnodemodelindex.html#DocumentOrder-enum">QXmlNodeModelIndex::Follows</a> is returned.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#document-order">XQuery 1.0 and XPath 2.0 Data Model (XDM), 2.4 Document Order</a>.</p>
<!-- @@@compareOrder -->
<!-- $$$createIndex[overload1]$$$createIndexqint64 -->
<h3 class="fn"><a name="createIndex"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">createIndex</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>data</i> ) const<tt> [protected]</tt></h3>
<p>Creates a node index with <i>data</i> as its internal data. <i>data</i> is not constrained.</p>
<!-- @@@createIndex -->
<!-- $$$createIndex$$$createIndexvoid*qint64 -->
<h3 class="fn"><a name="createIndex-2"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">createIndex</span> ( <span class="type">void</span> * <i>pointer</i>, <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>additionalData</i> = 0 ) const<tt> [protected]</tt></h3>
<p>Creates a node index with <i>pointer</i> and <i>additionalData</i> as its internal data.</p>
<p>What <i>pointer</i> and <i>additionalData</i> is, is not constrained.</p>
<!-- @@@createIndex -->
<!-- $$$createIndex$$$createIndexqint64qint64 -->
<h3 class="fn"><a name="createIndex-3"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">createIndex</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>data</i>, <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>additionalData</i> ) const<tt> [protected]</tt></h3>
<p>This is an overloaded function.</p>
<p>Creates a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> containing <i>data</i> and <i>additionalData</i>.</p>
<!-- @@@createIndex -->
<!-- $$$documentUri[overload1]$$$documentUriconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="documentUri"></a><span class="type"><a href="qurl.html">QUrl</a></span> QAbstractXmlNodeModel::<span class="name">documentUri</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>n</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the document URI of <i>n</i>. The document URI identifies the resource which is the document. For example, the document could be a regular file, e.g&#x2e;, <tt>file:/</tt>, or it could be the <tt>http://</tt> URL of the location of a file. The document URI is used for resolving URIs and to simply know where the document is.</p>
<p>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.</p>
<p>The caller guarantees that <i>n</i> is not <tt>null</tt> and that it belongs to this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p>This function maps to the <tt>dm:document-uri</tt> accessor, which returns a document URI according to the following:</p>
<ul>
<li>If <i>n</i> is a document node, return an absolute <a href="qurl.html">QUrl</a> containing the document URI, or a default constructed <a href="qurl.html">QUrl</a>. The latter signals that no document URI is available for the document node.</li>
<li>For all other nodes, return a default constructed <a href="qurl.html">QUrl</a>.</li>
</ul>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#dm-document-uri">XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.4 document-uri Accessor</a>, <a href="qurl.html#isValid">QUrl::isValid</a>(), and <a href="qurl.html#isRelative">QUrl::isRelative</a>().</p>
<!-- @@@documentUri -->
<!-- $$$elementById[overload1]$$$elementByIdconstQXmlName& -->
<h3 class="fn"><a name="elementById"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">elementById</span> ( const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &amp; <i>id</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the index of the element identified as <i>id</i>. <a href="xmlprocessing.html">XQuery</a>'s <tt>id()</tt> function calls this function.</p>
<p>The node index returned will be the element node whose value is of type <tt>ID</tt> and equals <i>id</i>, or it will be the element node that has an attribute whose typed value is of type <tt>ID</tt> and equals <i>id</i>. If there is no such element, a default constructed <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> instance is returned. The implementor guarantees that if the returned node index is not null, it identifies an element.</p>
<p>It is not sufficient for an attribute or element to merely be called <tt>id</tt>. Its value type must also be <tt>ID</tt>. However, the reserved name <tt>xml:id</tt> is sufficient.</p>
<p>In <i>id</i>, the <tt>namespace URI</tt> and the <tt>prefix</tt> are undefined, and the <tt>local name</tt> is the ID that should be looked up.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-functions/#func-id">XQuery 1.0 and XPath 2.0 Functions and Operators, 15.5&#x2e;2 fn:id</a>.</p>
<!-- @@@elementById -->
<!-- $$$kind[overload1]$$$kindconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="kind"></a><span class="type"><a href="qxmlnodemodelindex.html#NodeKind-enum">QXmlNodeModelIndex::NodeKind</a></span> QAbstractXmlNodeModel::<span class="name">kind</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>ni</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns a value indicating the kind of node identified by <i>ni</i>. The caller guarantees that <i>ni</i> is not null and that it identifies a node in this node model. This function maps to the <tt>dm:node-kind()</tt> accessor.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#dm-node-kind">XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.10 node-kind Accessor</a>.</p>
<!-- @@@kind -->
<!-- $$$name[overload1]$$$nameconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="name"></a><span class="type"><a href="qxmlname.html">QXmlName</a></span> QAbstractXmlNodeModel::<span class="name">name</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>ni</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the name of <i>ni</i>. The caller guarantees that <i>ni</i> is not <tt>null</tt> and that it belongs to this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p>If a node does not have a name, e.g&#x2e;, comment nodes, a null <a href="qxmlname.html">QXmlName</a> is returned. QXmlNames must be created with the instance of <a href="qxmlquery.html">QXmlQuery</a> that is being used for evaluating queries using this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p>This function maps to the <tt>dm:node-name()</tt> accessor.</p>
<p>If <i>ni</i> is a processing instruction, a <a href="qxmlname.html">QXmlName</a> is returned with the local name as the target name and the namespace URI and prefix both empty.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#dm-node-name">XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.11 node-name Accessor</a> and <a href="qxmlname.html">QXmlName</a>.</p>
<!-- @@@name -->
<!-- $$$namespaceBindings[overload1]$$$namespaceBindingsconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="namespaceBindings"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qxmlname.html">QXmlName</a></span>&gt; QAbstractXmlNodeModel::<span class="name">namespaceBindings</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>n</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the in-scope namespaces of <i>n</i>. The caller guarantees that <i>n</i> is not <tt>null</tt> and that it belongs to this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<p>This function corresponds to the <tt>dm:namespace-nodes</tt> accessor.</p>
<p>The returned vector of namespace declarations includes namespaces of the ancestors of <i>n</i>.</p>
<p>The caller guarantees that <i>n</i> is an Element that belongs to this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a>.</p>
<!-- @@@namespaceBindings -->
<!-- $$$nextFromSimpleAxis[overload1]$$$nextFromSimpleAxisSimpleAxisconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="nextFromSimpleAxis"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">nextFromSimpleAxis</span> ( <span class="type"><a href="qabstractxmlnodemodel.html#SimpleAxis-enum">SimpleAxis</a></span> <i>axis</i>, const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>origin</i> ) const<tt> [pure virtual protected]</tt></h3>
<p>When <a href="qtxmlpatterns.html">QtXmlPatterns</a> evaluate path expressions, it emulate them through a combination of calls with <a href="qabstractxmlnodemodel.html#SimpleAxis-enum">QSimpleXmlNodeModel::SimpleAxis</a> values. Therefore, the implementation of this function must return the node, if any, that appears on the <i>axis</i> emanating from the <i>origin</i>.</p>
<p>If no such node is available, a default constructed <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> is returned.</p>
<p><a href="qsimplexmlnodemodel.html">QSimpleXmlNodeModel</a> eliminates the need to handle redundant corner cases by guaranteeing that it will never ask for:</p>
<ul>
<li>Children or siblings for attributes.</li>
<li>Children for comments, processing instructions, and text nodes.</li>
<li>Siblings or parents for document nodes.</li>
</ul>
<p>A typical implementation performs a <tt>switch</tt> on the value of <i>axis</i>:</p>
<pre class="cpp"> <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> MyTreeModel<span class="operator">::</span>nextFromSimpleAxis(SimpleAxis axis<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> <span class="operator">&amp;</span>origin) <span class="keyword">const</span>
 {
   <span class="comment">// Convert the QXmlNodeModelIndex to a value that is specific to what we represent.</span>
   <span class="keyword">const</span> MyValue value <span class="operator">=</span> toMyValue(ni);

   <span class="keyword">switch</span>(axis)
   {
       <span class="keyword">case</span> Parent:
           <span class="keyword">return</span> toNodeIndex(value<span class="operator">.</span>parent());
       <span class="keyword">case</span> FirstChild:
       <span class="keyword">case</span> PreviousSibling:
       <span class="keyword">case</span> NextSibling:
           <span class="comment">// and so on</span>
   }
 }</pre>
<!-- @@@nextFromSimpleAxis -->
<!-- $$$nodesByIdref[overload1]$$$nodesByIdrefconstQXmlName& -->
<h3 class="fn"><a name="nodesByIdref"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span>&gt; QAbstractXmlNodeModel::<span class="name">nodesByIdref</span> ( const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &amp; <i>idref</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the elements and/or attributes that have an <tt>IDREF</tt> value equal to <i>idref</i>. <a href="xmlprocessing.html">XQuery</a>'s <tt>idref()</tt> function calls this function.</p>
<p>The implementor guarantees that the nodes identified by the returned indexes are elements or attributes.</p>
<p>It is not sufficient for an attribute or element to merely be called <tt>idref</tt>. It must also be of type <tt>IDREF</tt>. Elements must be typed as <tt>xs:IDREF</tt> or <tt>xs:IDREFS</tt>, or, in the case of attributes, as <tt>IDREF</tt> or <tt>IDREFS</tt> in the schema.</p>
<p>In <i>idref</i>, the <tt>namespace URI</tt> and the <tt>prefix</tt> are undefined, and the <tt>local name</tt> is the ID that should be looked up.</p>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-functions/#func-idref">XQuery 1.0 and XPath 2.0 Functions and Operators, 15.5&#x2e;3 fn:idref</a>.</p>
<!-- @@@nodesByIdref -->
<!-- $$$root[overload1]$$$rootconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="root"></a><span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> QAbstractXmlNodeModel::<span class="name">root</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>n</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the root node of the tree that contains the node whose index is <i>n</i>. The caller guarantees that <i>n</i> is not <tt>null</tt> and that it identifies a node in this node model.</p>
<p>If <i>n</i> identifies a node that is a direct child of the root, parent() would return the same <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> returned by this function.</p>
<!-- @@@root -->
<!-- $$$sourceLocation[overload1]$$$sourceLocationconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="sourceLocation"></a><span class="type"><a href="qsourcelocation.html">QSourceLocation</a></span> QAbstractXmlNodeModel::<span class="name">sourceLocation</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>index</i> ) const</h3>
<p>Returns the source location for the object with the given <i>index</i> or a default constructed <a href="qsourcelocation.html">QSourceLocation</a> in case no location information is available.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@sourceLocation -->
<!-- $$$stringValue[overload1]$$$stringValueconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="stringValue"></a><span class="type"><a href="qstring.html">QString</a></span> QAbstractXmlNodeModel::<span class="name">stringValue</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>n</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the string value for node <i>n</i>.</p>
<p>The caller guarantees that <i>n</i> is not <tt>null</tt> and that it belong to this <a href="qabstractxmlnodemodel.html">QAbstractXmlNodeModel</a> instance.</p>
<p>This function maps to the <tt>dm:string-value()</tt> accessor, which the specification completely specifies. Here's a summary:</p>
<ul>
<li>For processing instructions, the string value is the data section(excluding any whitespace appearing between the name and the data).</li>
<li>For text nodes, the string value equals the text node.</li>
<li>For comments, the content of the comment</li>
<li>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.</li>
<li>For document nodes, the concatenation of all text nodes in the document.</li>
</ul>
<p><b>See also </b><a href="http://www.w3.org/TR/xpath-datamodel/#dm-string-value">XQuery 1.0 and XPath 2.0 Data Model (XDM), 5.13 string-value Accessor</a>.</p>
<!-- @@@stringValue -->
<!-- $$$typedValue[overload1]$$$typedValueconstQXmlNodeModelIndex& -->
<h3 class="fn"><a name="typedValue"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAbstractXmlNodeModel::<span class="name">typedValue</span> ( const <span class="type"><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a></span> &amp; <i>node</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the typed value for node <i>node</i>.</p>
<p>The typed value is an atomic value, which an element or attribute contains.</p>
<p>The caller guarantees that <i>node</i> is either an element or an attribute. The implementor guarantees that the returned <a href="qvariant.html">QVariant</a> has a value which is supported in <a href="xmlprocessing.html">XQuery</a>. It cannot be an arbitrary <a href="qvariant.html">QVariant</a> value. The implementor also guarantees that <a href="qabstractxmlnodemodel.html#stringValue">stringValue</a>() returns a lexical representation of typedValue()(this is guaranteed by <a href="qsimplexmlnodemodel.html#stringValue">QSimpleXmlNodeModel::stringValue</a>()).</p>
<p>If the return <a href="qvariant.html">QVariant</a> is a default constructed variant, it signals that <i>node</i> has no typed value.</p>
<!-- @@@typedValue -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>