caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* XML library for validating MathML
@ 2008-09-17 18:58 Dario Teixeira
  2008-09-17 22:13 ` [Caml-list] " Richard Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Dario Teixeira @ 2008-09-17 18:58 UTC (permalink / raw)
  To: caml-list

Hi,

Given a string containing a mathematical expression in the MathML
markup, I need to verify that the expression is indeed valid MathML.
I am therefore looking for an XML library that can verify an expression
against a given DTD.

Now, I have tried Xml-light, and the code I used is listed below.
Unfortunately, it fails when trying to parse MathML's DTD (it's the
standard DTD from the W3C).  I have tried simpler DTDs, and it does work
with them; am I therefore correct in assuming that Xml-light can only
handle a particular version/subset of DTD features?

let () =
        try
                let x = Xml.parse_file "file.xml" in
                let dtd = Dtd.parse_file "mathml.dtd" in
                let checked = Dtd.check dtd in
                let proven = Dtd.prove checked "math" x in
                print_endline (Xml.to_string proven)
        with
                Dtd.Parse_error exc -> print_endline (Dtd.parse_error exc)


There are of course other XML libraries for Ocaml and let's not forget Cduce.
Can someone recommend one solution that is guaranteed to work with the
MathML DTD?  Note that I don't need to do much with the XML tree; pretty
much all I need is a boilerplate function that returns a boolean on whether
a string is valid or not.

Thanks in advance for your input!
Best regards,
Dario Teixeira






^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-09-19 13:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-17 18:58 XML library for validating MathML Dario Teixeira
2008-09-17 22:13 ` [Caml-list] " Richard Jones
2008-09-18  2:58   ` Matt Gushee
2008-09-18  8:06     ` Re : " Adrien
2008-09-18  8:38 ` Vincent Hanquez
2008-09-18  9:12   ` Till Varoquaux
2008-09-18  9:44     ` Vincent Hanquez
2008-09-18 11:52     ` Gerd Stolpmann
2008-09-18 13:35       ` Markus Mottl
2008-09-19 11:30       ` Matt Gushee
2008-09-18 14:26 ` Dario Teixeira
2008-09-18 17:58   ` Dario Teixeira
2008-09-18 18:28     ` Gerd Stolpmann
2008-09-18 20:44       ` Dario Teixeira
2008-09-18 20:48         ` Gerd Stolpmann
2008-09-19 13:23         ` Stefano Zacchiroli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).