Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 6509

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Qt 4.6: statisticsInHTML.xq Example File (xmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">statisticsInHTML.xq Example File<br /><span class="small-subtitle">xmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq</span>
</h1>
<pre> &lt;html&gt;
   &lt;head&gt;
     &lt;title&gt;&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
     &lt;p&gt;In total the tree has {count($root//QObject)} QObject instances.&lt;/p&gt;
     &lt;p&gt;Order by occurrence, the QObjects are:&lt;/p&gt;

     &lt;ol&gt;
     {
       for $i in $root/preceding-sibling::metaObjects/metaObject
       let $count := count($root//QObject[@className eq $i/@className])
       stable order by $count descending
       return if($count &gt; 1)
              then &lt;li&gt;{string($i/@className), $count} occurrences&lt;/li&gt;
              else ()
     }
     &lt;/ol&gt;

     &lt;h1&gt;Properties&lt;/h1&gt;
     {
       (: For each QObject, we create a table listing
        : the properties of that object. :)
       for $object in $root//QObject
         return (&lt;h2&gt;{let $name := string($object/@objectName)
                      return if(string-length($name))
                             then $name
                             else &quot;[no name]&quot;,
                      '(', string($object/@className), ')'}&lt;/h2&gt;,
                 &lt;table border=&quot;1&quot;&gt;
                   &lt;thead&gt;
                     &lt;tr&gt;
                       &lt;td&gt;Property Name&lt;/td&gt;
                       &lt;td&gt;Value&lt;/td&gt;
                     &lt;/tr&gt;
                   &lt;/thead&gt;
                   &lt;tbody&gt;
                   {
                     $object/@*/&lt;tr&gt;
                                  &lt;td&gt;
                                  {
                                    name()
                                  }
                                  &lt;/td&gt;
                                  &lt;td&gt;
                                  {
                                    if(data(.))
                                    then string(.)
                                    else &quot;N/A&quot;
                                  }
                                  &lt;/td&gt;
                                &lt;/tr&gt;
                   }
                   &lt;/tbody&gt;
                 &lt;/table&gt;)
     }
   &lt;/body&gt;
 &lt;/html&gt;</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>