Commit cdca399c authored by Pietro Abate's avatar Pietro Abate

[r2005-01-03 16:22:00 by afrisch] Don't generate xmlns:xml declaration

Original author: afrisch
Date: 2005-01-03 16:22:38+00:00
parent eae01f30
(* TODO:
special treatment of prefixes xml and xmlns *)
special treatment of prefixes xml and xmlns.
Disallow: namespace xml="..."
*)
module U = Encodings.Utf8
let empty_str = U.mk ""
......@@ -166,7 +168,8 @@ module Printer = struct
then p.prefixes <- (pr, ns) :: p.prefixes
let register_ns p ns =
match get_prefix p ns with
if ns == xml_ns then ()
else match get_prefix p ns with
| { contents = Hint l } as r ->
let pr = find_good_prefix p ns l in
r := Set pr;
......@@ -179,7 +182,8 @@ module Printer = struct
let prefixes p = p.prefixes
let tag p (ns,l) =
match !(get_prefix p ns) with
if ns == xml_ns then "xml:" ^ (U.get_str l)
else match !(get_prefix p ns) with
| Set pr ->
let pr = U.get_str pr in
if pr = "" then (U.get_str l)
......@@ -187,7 +191,8 @@ module Printer = struct
| _ -> assert false
let attr p (ns,l) =
if ns == empty then (U.get_str l)
if ns == xml_ns then "xml:" ^ (U.get_str l)
else if ns == empty then (U.get_str l)
else
match !(get_prefix p ns) with
| Set pr ->
......
......@@ -14,8 +14,9 @@
<pages-toc/>
</left>
<external href="http://reglisse.ens.fr/cgi-bin/cduce" title="Online
demo" name="proto"/>
<!--<external href="http://reglisse.ens.fr/cgi-bin/cduce" title="Online
demo" name="proto"/>-->
<external href="/cgi-bin/cduce" title="Online demo" name="proto"/>
<include file="demo.xml"/>
<include file="download.xml"/>
<include file="bench.xml"/>
......
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