From: Nicolas C. <war...@fr...> - 2003-04-18 03:14:52
|
Hi list ! I'm currently rewriting my Xml-Light library which is a minimal Xml parser/printer and adding DTD support to it. It's almost done (all parsing is ok, now I still have to do some testing and DTD proving) but before releasing it, since I would like it to be part of the ExtLib, I'm calling for features / comments. Here's joined the current MLI for Xml and Dtd - not yet finalized. The implementation code is quite small, there is a lexer and a small parser for DTD elements expressions. Any comments are welcomed ! Nicolas Cannasse |
From: Olivier A. <ol...@us...> - 2003-04-18 08:30:18
|
Hi, Nicolas Cannasse [Friday 18 April 2003] : > I'm currently rewriting my Xml-Light library which is a minimal Xml > parser/printer and adding DTD support to it. It's almost done (all parsing > is ok, now I still have to do some testing and DTD proving) but before > releasing it, since I would like it to be part of the ExtLib, I'm calling > for features / comments. Here's joined the current MLI for Xml and Dtd - not > yet finalized. The implementation code is quite small, there is a lexer and > a small parser for DTD elements expressions. You're using `parser' as an identifier for a type : it clashes with camlp4 where `parser' is a keyword introducing stream matching. Maybe it should be named something else. -- Olivier |
From: Claudio S. C. <sac...@cs...> - 2003-04-22 08:43:48
|
> I'm currently rewriting my Xml-Light library which is a minimal Xml > parser/printer and adding DTD support to it. Is it? Is it _really_ a minimal XML parser/printer? I fear it is just a parser/printer for a minimal _subset_ of XML! (e.g. Does it supports UNICODE characters? What about Entities? What about Notation? Is it 100% fully compliant with the spec?) We do not need yet another standard for documents. Either it is fully XML compliant (and there is already PXP - native ocaml - or gdome2-ocaml - binding to libgdome) or it is unuseful/threatening. Friendly, C.S.C. -- ---------------------------------------------------------------- Real name: Claudio Sacerdoti Coen PhD Student in Computer Science at University of Bologna E-mail: sac...@cs... http://www.cs.unibo.it/~sacerdot ---------------------------------------------------------------- |
From: Nicolas C. <war...@fr...> - 2003-04-23 05:06:50
|
> > I'm currently rewriting my Xml-Light library which is a minimal Xml > > parser/printer and adding DTD support to it. > > Is it? Is it _really_ a minimal XML parser/printer? > I fear it is just a parser/printer for a minimal _subset_ of XML! Yes it is. > (e.g. Does it supports UNICODE characters? What about Entities? > What about Notation? Is it 100% fully compliant with the spec?) No, no, no, and no :-) > We do not need yet another standard for documents. Either it is > fully XML compliant (and there is already PXP - native ocaml - > or gdome2-ocaml - binding to libgdome) or it is unuseful/threatening. Why do you think then I am "loosing" my time writing it then ? PXP is huge, complex, didn't managed to compiled it under Win32 in one day, but quite complete : this library is for "professionnal" XML users. Let me explain my thoughts... As far as I know, there is a lot of differents ways of using XML, and I'm pretty sure that about 85% of the usages are for configuration files and import/export of XML data. Theses usages needs only the _subset_ of all the XML specs that Xml Light will support, I have no ambition of rewriting a PXP, but I think it will be good for the OCaml community to have such a small thing available. Of course, I would like to be as much compliant with the spec, so please review the code once released. So I don't think its unuseful since I already had several users enjoying the previous version of Xml Light which was not even supporting CDATA et PCDATA ! And I don't think it's threatening either since with the help of the community we will stick to a given subset of the specs. Nicolas Cannasse |
From: Blair Z. <bl...@or...> - 2003-04-23 05:21:38
|
Nicolas Cannasse wrote: > > PXP is huge, complex, didn't managed to compiled it under Win32 in one day, > but quite complete : this library is for "professionnal" XML users. Let me > explain my thoughts... As far as I know, there is a lot of differents ways > of using XML, and I'm pretty sure that about 85% of the usages are for > configuration files and import/export of XML data. Theses usages needs only > the _subset_ of all the XML specs that Xml Light will support, I have no > ambition of rewriting a PXP, but I think it will be good for the OCaml > community to have such a small thing available. Of course, I would like to > be as much compliant with the spec, so please review the code once released. > > So I don't think its unuseful since I already had several users enjoying the > previous version of Xml Light which was not even supporting CDATA et PCDATA > ! And I don't think it's threatening either since with the help of the > community we will stick to a given subset of the specs. What about putting an easy to use wrapper around PXP then? How about helping PXP run on Windows then? I'm sure I'm talking to a programmer here who, like me, would like to write new code rather than use existing code :) Best, Blair -- Blair Zajac <bl...@or...> Plots of your system's performance - http://www.orcaware.com/orca/ |
From: Nicolas C. <war...@fr...> - 2003-04-23 05:35:01
|
> > PXP is huge, complex, didn't managed to compiled it under Win32 in one day, > > but quite complete : this library is for "professionnal" XML users. Let me > > explain my thoughts... As far as I know, there is a lot of differents ways > > of using XML, and I'm pretty sure that about 85% of the usages are for > > configuration files and import/export of XML data. Theses usages needs only > > the _subset_ of all the XML specs that Xml Light will support, I have no > > ambition of rewriting a PXP, but I think it will be good for the OCaml > > community to have such a small thing available. Of course, I would like to > > be as much compliant with the spec, so please review the code once released. > > > > So I don't think its unuseful since I already had several users enjoying the > > previous version of Xml Light which was not even supporting CDATA et PCDATA > > ! And I don't think it's threatening either since with the help of the > > community we will stick to a given subset of the specs. > > What about putting an easy to use wrapper around PXP then? How about > helping PXP run on Windows then? > > I'm sure I'm talking to a programmer here who, like me, would like to > write new code rather than use existing code :) I can't deny I am :-) But I have also good arguments for it, for example the code size of the resulting library binary won't exceed few KB. PXP have to go its own way, there is really enough space and need for one library like Xml Light, don't you think ? Nicolas Cannasse |
From: Blair Z. <bl...@or...> - 2003-04-23 06:00:31
|
Nicolas Cannasse wrote: > > resulting library binary won't exceed few KB. > PXP have to go its own way, there is really enough space and need for one > library like Xml Light, don't you think ? If you want my real opinion, after reading some of the Tim Bray discussions recently on the pros and cons of working with XML http://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog I was looking forward to messing around with a regex style XML processor. It looks much easier than any of the event, push, pull models of working with XML. Getting a Ocaml version of this would be cool and be a new direction in processing XML. Did you see the XML is too hard thread recently? Check out http://www.google.com/search?q=xml+too+hard Best, Blair -- Blair Zajac <bl...@or...> Plots of your system's performance - http://www.orcaware.com/orca/ |
From: Nicolas C. <war...@fr...> - 2003-04-23 07:26:46
|
> > resulting library binary won't exceed few KB. > > PXP have to go its own way, there is really enough space and need for one > > library like Xml Light, don't you think ? > > If you want my real opinion, after reading some of the Tim Bray > discussions recently on the pros and cons of working with XML > > http://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog > > I was looking forward to messing around with a regex style XML > processor. It looks much easier than any of the event, push, > pull models of working with XML. > > Getting a Ocaml version of this would be cool and be a new > direction in processing XML. The OCaml pattern matching is enough for that, don't you think ? while (<STDIN>) { next if (X<meta>X); if (X<h1>|<h2>|<h3>|<h4>X) { $divert = 'head'; } elsif (X<img src="/^(.*\.jpg)$/i>X) { &proc_jpeg($1); } # and so on... } OCaml : let process = function | Elements ("meta",_,_) -> () | Elements ("h1",_,_) | Elements ("h2",_,_) | Elements ("h3",_,_) | Elements ("h4",_,_) -> divert := "head" | Elements ("img",attr,_) as x -> proc_jpeg (Xml.attrib x "src") | ... (* and so on *) in let rec walk = function | PCData _ -> () | Elements (_,_,children) as x -> process x; List.iter walk children in walk (Xml.parse_in stdin) Of course, this version is first reading all stdin and parsing it as a Xml tree before processing, but I'm thinking right now of adding Lazy xml processing to Xml Light so you parse only what you need. Others things possible are to generate a MLI file from an DTD which will provide all types and conversion functions from and to XML. Nicolas Cannasse |
From: Olivier A. <ol...@us...> - 2003-04-23 08:19:53
|
Nicolas Cannasse [Wednesday 23 April 2003] : > > If you want my real opinion, after reading some of the Tim Bray > > discussions recently on the pros and cons of working with XML > > > > http://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog > > > > I was looking forward to messing around with a regex style XML > > processor. It looks much easier than any of the event, push, > > pull models of working with XML. > > > > Getting a Ocaml version of this would be cool and be a new > > direction in processing XML. > > The OCaml pattern matching is enough for that, don't you think ? > OCaml : > > let process = function > | Elements ("meta",_,_) -> () > | Elements ("h1",_,_) | Elements ("h2",_,_) | Elements ("h3",_,_) | > Elements ("h4",_,_) -> divert := "head" > | Elements ("img",attr,_) as x -> proc_jpeg (Xml.attrib x "src") > | ... (* and so on *) > in > let rec walk = function > | PCData _ -> () > | Elements (_,_,children) as x -> > process x; > List.iter walk children > in > walk (Xml.parse_in stdin) Here's another solution for reading XML : that's the xml lexer included in the LablGTK sources. It's an ocamllex lexer and you can parse the stream with a camlp4 parser. -- Olivier |
From: Nicolas C. <war...@fr...> - 2003-04-23 08:58:07
|
> Here's another solution for reading XML : that's the xml lexer > included in the LablGTK sources. It's an ocamllex lexer and you can > parse the stream with a camlp4 parser. The new Xml Light is based on the same lexer, since some talks with Jacques Garrigue on what is best for Xml parsing, he give me the right to use the sources. But it doesn't need camlp4. Nicolas Cannasse |