xtrans.cd 553 Bytes
Newer Older
1
2
include "../web/xhtml-strict.cd";;

3

4
let fun f (x : Xhtml) : [ Xhtml ] =
5
6
7
  xtransform [ x ] with <a>t -> [];;


8

9
let fun g (x : Xhtml) : [ Xhtml ] =
10
11
12
  xtransform [ x ] with <a>t -> [ <b>t ];;


13

14

15
16
17
18
19

type T = <a>[ <b>[] T* <b>[] ];;
type S = <a>[ <x>[] S* <x>[] ];;

let fun f (x : [ T ]) : [ S ] =
20
  xtransform x with <b>_ -> [ <x>[] ];;
21
22

let x = f [ <a>[ <b>[] <b>[] ] ];;
23

24

25
26
27
28
29
(*fun (x : Xhtml) : [Xhtml] = xtransform [x] with <h1>s -> [ ];;*)
(*let x : Xhtml =
 <html>[ <head>[ <object>[ <p>[ <a>[ <map id="">[] ] ] ] <title>[] ]
         <body>[] ]
*)
30
31