diff -r 000000000000 -r 1918ee327afb examples/xmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/xmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq Mon Jan 11 14:00:40 2010 +0000 @@ -0,0 +1,58 @@ + + + + + +

In total the tree has {count($root//QObject)} QObject instances.

+

Order by occurrence, the QObjects are:

+ +
    + { + 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 > 1) + then
  1. {string($i/@className), $count} occurrences
  2. + else () + } +
+ +

Properties

+ { + (: For each QObject, we create a table listing + : the properties of that object. :) + for $object in $root//QObject + return (

{let $name := string($object/@objectName) + return if(string-length($name)) + then $name + else "[no name]", + '(', string($object/@className), ')'}

, + + + + + + + + + { + $object/@*/ + + + + } + +
Property NameValue
+ { + name() + } + + { + if(data(.)) + then string(.) + else "N/A" + } +
) + } + +