X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Fexamples%2Fsimple_transformation%2Fdelcol.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Fexamples%2Fsimple_transformation%2Fdelcol.ml;h=0000000000000000000000000000000000000000;hb=c7514aaa249a96c5fdd39b1123fbdb38d92f20b6;hp=57c33278803b9e6d4f5b79544489f39dd34626f4;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/examples/simple_transformation/delcol.ml b/helm/DEVEL/pxp/pxp/examples/simple_transformation/delcol.ml deleted file mode 100644 index 57c332788..000000000 --- a/helm/DEVEL/pxp/pxp/examples/simple_transformation/delcol.ml +++ /dev/null @@ -1,69 +0,0 @@ -(* $Id$ - * ---------------------------------------------------------------------- - * - *) - -(* Read a record-list, delete a column, and print it as XML *) -open Pxp_types;; -open Pxp_document;; -open Pxp_yacc;; - -let delcol col tree = - map_tree - ~pre: - (fun n -> - match n # node_type with - T_element name when name = col -> - raise Skip - | _ -> n # orphaned_flat_clone) - tree -;; - - -let main() = - let column = ref "" in - Arg.parse - [ "-col", Arg.String (fun s -> column := s), - " (last-name|first-name|phone)"; - ] - (fun _ -> raise (Arg.Bad "Bad usage")) - "usage: sort [ options ]"; - if !column = "" then ( - prerr_endline "Column not specified!"; - exit 1; - ); - if not(List.mem !column ["last-name"; "first-name"; "phone"]) then ( - prerr_endline ("Unknown column: " ^ !column); - exit 1 - ); - try - let dtd = parse_dtd_entity default_config (from_file "record.dtd") in - let tree = - parse_content_entity default_config (from_channel stdin) dtd default_spec - in - print_endline ""; - (delcol !column tree) # write (Out_channel stdout) `Enc_iso88591 - with - x -> - prerr_endline(string_of_exn x); - exit 1 -;; - - -main();; - -(* ====================================================================== - * History: - * - * $Log$ - * Revision 1.1 2000/11/17 09:57:32 lpadovan - * Initial revision - * - * Revision 1.2 2000/08/24 09:42:52 gerd - * Updated a comment. - * - * Revision 1.1 2000/08/24 09:39:59 gerd - * Initial revision. - * - * - *)