Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
2ac3c8aa
Commit
2ac3c8aa
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-12-01 13:53:25 by cmiachon] CQL: q9
Original author: cmiachon Date: 2003-12-01 13:53:25+00:00
parent
75a64da6
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/cql/q5.cd
View file @
2ac3c8aa
(* /@ not implemented
(* include "tests/cql/doc.cd" ;; *)
(* include "tests/cql/doc-q5.cd" ;; *)
let q5x =
<books-with-prices>
...
...
@@ -10,8 +11,7 @@ from b in [doc]/<book>_ ,
t2 in [e]/<title>_,
p2 in [e]/<price>_,
p1 in [b]/<price>_
where t1=t2 and int_of(y)>>1990;;
*)
where t1=t2 and int_of(y)>>1991;;
let q5p =
...
...
tests/cql/q7.cd
View file @
2ac3c8aa
include "tests/cql/doc.cd";;
(* tri a bulle *)
...
...
tests/cql/q9.cd
0 → 100644
View file @
2ac3c8aa
(*
In the document books.xml,
find all section or chapter titles that contain the word XML,
regardless of the level of nesting.
include "tests/cql/books.cd" ;;
include "tests/cql/q9.cd";;
*)
(* This query needs the Xpath // *)
(* first version of // *)
let stack = ref [<title>[_* 'XML' ;_]*] []
in let result ( [] : [] ) : [<title>[_* 'XML' ;_]*] =
match !stack with [x; y] -> [x;y] | _ -> []
in let _ = xtransform [books] with
t&<title>[_* 'XML' ;_] -> stack := [t;!stack]; [t]
in result [] ;;
(* problem: l ordre est inverse wrt the Use Case s response *)
(* subjection
e//T
where e is a sequence and T a type
is translated as :
let stack = ref [T*] []
in let result ( [] : [] ) : [T*] =
match !stack with l -> stack := [] ; l
in let _ = xtransform [books] with
x&T -> stack := [x;! stack]; [x]
in result [] ;;
maybe stack and the function result should be only defined one time
an other problem is that we are not CQLp corresponding ...
*)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment