From: "Nicolas Cannasse" <warplayer@free.fr>
To: "David MENTRE" <dmentre@linux-france.org>
Cc: "OCaml" <caml-list@inria.fr>
Subject: Re: [Caml-list] Looking for OCaml code to load & save XML files
Date: Sun, 29 Feb 2004 19:13:03 +0100 [thread overview]
Message-ID: <001601c3feef$acb30c80$0100a8c0@PWARP> (raw)
In-Reply-To: <871xodlqx3.fsf@linux-france.org>
> > My advice : first experiment XmlLight and then switch to PXP if you lack
> > features.
> >
> > http://tech.motion-twin.com/xmllight
>
> I like you advice. I've looked at your library and it's conciseness and
> lack of dependencies pleases me.
>
> BTW, I need to save some short binary data in the XML format (e.g. MD5
> 128bits hash). Therefore, I would like to transform from/to an OCaml
> binary string type into a string suitable for printing in an XML file
> (in a CDATA field). Which code would you recommend to do that the "XML
> way"? At first sight, I intend to use Gerd's code to encode/decode MIME
> and base64 strings.
If your goal is to minimise dependencies, just writing some lines of B64
encode/decode is a good idea (btw, this could be a good add-on for ExtLib :
http://ocaml-lib.sf.net ).
> As another side note, I also intend to read and write gziped XML files,
> using Xavier's camlzip package. As your module uses Lexing.from_* to get
> input file, I'll probably add an SFunction source type to be able to use
> Lexing.from_function. In the same way, I'll probably modify your output
> functions (Xml.to_string) to be able to ouput into a Gzip.out_channel
> without producing the whole XML file in a string.
>
> I'll gladly accept any advice on how to use your code,
I think you don't need any special advice in order to add the SFunction to
XmlLight, it looks easy.
For gzip, XmlLight has 2 printers : Xml.to_string for "compact" mode
(without any line returns or indentation) and Xml.to_string_fmt for
"formatted" mode (a lot more user-readable). Writing a custom "compact"
printer which directly output the data into a Gzip.out_channel is also
something easy to do (look at to_string in xml.ml for example). Another way
is to add an event-driven printer that would be able to output on any
underlying data structure. If you need this, don't hesitate to ask and I
will add this to XmlLight.
You can contact me again if you have any question.
Regards,
Nicolas Cannasse
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2004-02-29 18:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-28 13:44 David MENTRE
2004-02-28 15:24 ` Nicolas Cannasse
2004-02-28 15:38 ` Benjamin Geer
2004-02-28 15:44 ` Nicolas Cannasse
2004-02-28 18:50 ` Stefano Zacchiroli
2004-02-28 20:02 ` Giuseppe Castagna
2004-02-29 17:53 ` Claudio Sacerdoti Coen
2004-02-29 17:46 ` David MENTRE
2004-02-29 18:13 ` Nicolas Cannasse [this message]
2004-03-01 8:09 ` lehalle@miriad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001601c3feef$acb30c80$0100a8c0@PWARP' \
--to=warplayer@free.fr \
--cc=caml-list@inria.fr \
--cc=dmentre@linux-france.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox