From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id CA008BBAF for ; Wed, 17 Sep 2008 20:58:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AigBAFPw0EjOvjGwmmdsb2JhbACTDgEBAQEBCAUIBxEDphoDhAU X-IronPort-AV: E=Sophos;i="4.32,417,1217800800"; d="scan'208";a="15062030" Received: from unknown (HELO web54606.mail.re2.yahoo.com) ([206.190.49.176]) by mail2-smtp-roc.national.inria.fr with SMTP; 17 Sep 2008 20:58:08 +0200 Received: (qmail 55239 invoked by uid 60001); 17 Sep 2008 18:58:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Vjp8O5cSEFhQllRJS838iejh38UOQfjdnTcRXN0vdyJpO1OWPH9I7a8upiYNMbAGgEXaVPIeB4j0CViDbQBrMJFN63dhIwUFFgQbYWoDv+GrlXAmIOHA4xjFaepaRFehv4NKtM06HbNoir8KHzGgDBIfSTPEPVaNC8k3qa9Rejo=; X-YMail-OSG: kc8w9rUVM1n6wJlUjNCkZshArSmqHMI9IAGaiW5jySyrVWZVq5In_I7HE5KU4t28nbaA3DEopU5xz4t5zUXJUMF_F0Sa4wcOhLrtIA9pce2tmrudO_taofW3TkS2lDECGgrZwBNq_nT8B24jL2KeGcu6QjWB2tI- Received: from [213.205.69.159] by web54606.mail.re2.yahoo.com via HTTP; Wed, 17 Sep 2008 11:58:05 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Wed, 17 Sep 2008 11:58:05 -0700 (PDT) From: Dario Teixeira Subject: XML library for validating MathML To: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <103293.54569.qm@web54606.mail.re2.yahoo.com> X-Spam: no; 0.00; dtds:01 subset:01 endline:01 endline:01 ocaml:01 cduce:01 boolean:01 expression:02 expression:02 tree:02 parse:02 parse:02 string:02 string:02 library:03 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 () =3D try let x =3D Xml.parse_file "file.xml" in let dtd =3D Dtd.parse_file "mathml.dtd" in let checked =3D Dtd.check dtd in let proven =3D 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 Cduc= e. 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 =0A=0A=0A