[Ocaml-pxp-users] Listing the namespaces in a dtd...
Gerd Stolpmann
info at gerd-stolpmann.de
Wed Mar 8 11:23:50 PST 2006
Am Mittwoch, den 08.03.2006, 18:46 +0100 schrieb Till Varoquaux:
> I want to list all the namespaces in a dtd. To do so I use:
>
> let man = dtd#namespace_manager in
> man#iter_namespaces(
> fun np ->
> Format.fprintf ppf "namespace %s=\"%s\"\n" np (man#get_primary_uri np)
> );
>
> However the only namespace that turns up is:
> namespace xml="http://www.w3.org/XML/1998/namespace"
>
> I am parsing the official Xhtml1 dtd, I should see at least:
> http://www.w3.org/1999/xhtml
> which is the default namespace. Is there something I'm missing here?
Yes. The DTD does not define namespaces. They are defined in the
document using them. The XHTML namespace should appear if you parse an
XHTML document that declares the namespace properly (and you must enable
namespace mode).
Gerd
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
gerd at gerd-stolpmann.de http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
More information about the Ocaml-pxp-users
mailing list