X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fwww%2Flambdadelta%2Fbin%2Fxhtbl%2FxmlUnparser.ml;h=0ff801e93c4c96e074f88bae7726058f7a1f9050;hb=43282d3750af8831c8100c60d75c56fdfb7ff3c9;hp=e46682c3f13bd8930379a2738d25d652e8dde476;hpb=2aa295aa37f8fb274f7b640f7627078d9435cefa;p=helm.git
diff --git a/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml b/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
index e46682c3f..0ff801e93 100644
--- a/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
+++ b/helm/www/lambdadelta/bin/xhtbl/xmlUnparser.ml
@@ -14,6 +14,13 @@ let myself = F.basename (Sys.argv.(0))
let msg = P.sprintf "This file was generated by %s, do not edit" myself
+let compose uri ext =
+ try
+ let i = S.index uri '#' in
+ let uri, fragment = S.sub uri 0 i, S.sub uri i (S.length uri - i) in
+ uri ^ ext ^ fragment
+ with Not_found -> uri ^ ext
+
let border cell =
let str = S.make 4 'n' in
if cell.M.cb.T.n then str.[0] <- 's';
@@ -26,9 +33,12 @@ let text baseuri ext = function
| T.Plain s -> s
| T.Link (true, uri, s) -> P.sprintf "%s" uri s
| T.Link (false, uri, s) ->
- let uri = !O.baseuri ^ baseuri ^ uri ^ ext in
+ let uri = !O.baseuri ^ baseuri ^ compose uri ext in
P.sprintf "%s" uri s
+let name cell =
+ if cell.M.cn = "" then "" else P.sprintf " id=\"%s\"" cell.M.cn
+
let key cell =
if cell.M.ck = [] then "
" else S.concat "" (L.map (text cell.M.cu cell.M.cx) cell.M.ck)
@@ -36,8 +46,8 @@ let ind i = S.make (2 * i) ' '
let out_cell och cell =
let cc = border cell in
- P.fprintf och "%s