X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fwww%2Flambdadelta%2Fbin%2Fxhtbl%2FxmlUnparser.ml;fp=helm%2Fwww%2Flambdadelta%2Fbin%2Fxhtbl%2FxmlUnparser.ml;h=f413aa0ef071632dd034054ea3dcf320386b6b27;hb=cb0d4e730bd6ec9bed1018be37748120f740f0a9;hp=3583c2f7536e95d045a4dd0776bbf81d4169b8c2;hpb=645b62762e9c86e343d4741541a2ddccfed8ebc7;p=helm.git
diff --git a/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml b/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
index 3583c2f75..f413aa0ef 100644
--- a/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
+++ b/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
@@ -22,8 +22,12 @@ let border cell =
if cell.M.cb.T.w then str.[3] <- 's';
str :: cell.M.cc
+let text = function
+ | T.Plain s -> s
+ | T.Link (uri, s) -> P.sprintf "%s" uri s
+
let key cell =
- if cell.M.ck = [] then "
" else S.concat " " cell.M.ck
+ if cell.M.ck = [] then "
" else S.concat " " (L.map text cell.M.ck)
let ind i = S.make (2 * i) ' '
@@ -37,16 +41,20 @@ let out_row och row =
A.iter (out_cell och) row;
P.fprintf och "%s\n" (ind (i+3))
+let out_space och (name, uri) =
+ let name = if name = "" then name else ":" ^ name in
+ P.fprintf och " xmlns%s=\"%s\"\n" name uri
+
(****************************************************************************)
-let open_out html name =
+let open_out name spaces =
let fname = F.concat !O.output_dir (P.sprintf "%s.xsl" name) in
+ let spaces = ("xsl", "http://www.w3.org/1999/XSL/Transform") :: spaces in
let och = open_out fname in
P.fprintf och "\n\n";
P.fprintf och "\n\n" msg;
P.fprintf och "\n\n";
och
@@ -72,7 +80,7 @@ let map_tbls och name =
P.fprintf och "%s\n" (ind (i+2))
let write_hook name incs tbls =
- let och = open_out false name in
+ let och = open_out name [] in
L.iter (map_incs och) incs;
P.fprintf och "\n\n" name;
P.fprintf och "%s\n" (ind (i+1));