Commit 5c6bae59 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-01-08 14:08:26 by cmiachon] Empty log message

Original author: cmiachon
Date: 2004-01-08 14:08:26+00:00
parent d40704bd
(* include "tests/cql/TREE/type-TREE.cd";; *)
(* include "tests/cql/TREE/q3.cd";; *)
(*How many sections are in Book1, and how many figures? *)
let fun count(x : [Any*]) : Int =
let tr_count((Int,[Any*]) -> Int)
| (n,[]) -> n
| (n,[_;t]) -> tr_count(n+1,t)
in tr_count(0,x);;
<figure-count>(count([book]//Figure));;
(* IN XQUERY
<section_count>{ count(doc("book.xml")//section) }</section_count>,
<figure_count>{ count(doc("book.xml")//figure) }</figure_count>
*)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment