Commit b7cf52c0 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-12-02 11:00:34 by cmiachon] e//t with order

Original author: cmiachon
Date: 2003-12-02 11:00:34+00:00
parent fe12c813
......@@ -10,12 +10,14 @@ 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 [] ;;
in !stack ;;
(* problem: l ordre est inverse wrt the Use Case s response *)
......@@ -26,11 +28,9 @@ 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 [] ;;
in let _ = xtransform [books] with
x & T -> stack := [x;! stack]; [x]
in !stack ;;
maybe stack and the function result should be only defined one time
......@@ -39,6 +39,14 @@ an other problem is that we are not CQLp corresponding ...
(* This one keeps order: *)
let stack = ref [<title>[_* 'XML' ;_]*] []
in let result ( [] : [] ) : [<title>[_* 'XML' ;_]*] =
match !stack with [x;y] -> stack := y ; result [] @ [x] | _ -> []
in let _ = xtransform [books] with
t&<title>[_* 'XML' ;_] -> stack := [t;!stack]; [t]
in result [] ;;
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