Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[Caml-list] [announce] XStream: streaming XML transformation

18 views
Skip to first unread message

Alain Frisch

unread,
Jun 28, 2006, 11:27:43 AM6/28/06
to caml...@inria.fr
Dear caml-list,

This is to announce the first public release of XStream, a simple
programming language for XML. Transformations written in XStream are
compiled into efficient XML stream processors: the output is computed
and produced while the input is being parsed, which makes it possible to
run some transformations on very big XML documents which could not even
fit in memory.

Though XStream is mostly intended as a back-end for higher-level
languages, it is also possible to use it directly. The language
features ML-like pattern matching and higher-order functions, but no types.


Here's how XStream relates to OCaml: the compiler is written in OCaml
and uses OCaml as a back-end to produce efficient native code. Moreover,
XStream programs can embed OCaml code and manipulate OCaml values
(useful to deal with non-XML data).


Web-site: http://yquem.inria.fr/~frisch/xstream


Alain

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

David MENTRE

unread,
Jun 28, 2006, 12:28:21 PM6/28/06
to Alain Frisch, caml...@inria.fr
Hello Alain,

2006/6/28, Alain Frisch <Alain....@inria.fr>:


> Here's how XStream relates to OCaml: the compiler is written in OCaml
> and uses OCaml as a back-end to produce efficient native code. Moreover,
> XStream programs can embed OCaml code and manipulate OCaml values
> (useful to deal with non-XML data).

It seems obvious but I want to be sure: can XStream generated code be
embedded in OCaml programs (native and bytecode)?

How XStream compares to OCamlDuce? From what you said, XStream can
only do XML->XML or XML->OCaml transformation, no OCaml->XML
transformation. So XStream cannot be used as a replacement to
OCamlDuce. Is it correct?

Best wishes,
d.

Alain Frisch

unread,
Jun 28, 2006, 12:46:59 PM6/28/06
to David MENTRE, caml...@inria.fr
Hello David,

David MENTRE wrote:
> It seems obvious but I want to be sure: can XStream generated code be
> embedded in OCaml programs (native and bytecode)?

Currently, XStream generates only a fully functional executable
transformaion which reads its input from an XML file and send its output
to the standard output.

It would be quite simple to have it generate an OCaml module which
exports a ``filter'' function (a transformer of XML event streams) if
there is some demand for such a feature.

> How XStream compares to OCamlDuce?

OCamlDuce is intended to write large OCaml applications which need to
manipulate XML data. XStream is really meant as an XML transformation
tool. In particular, to achieve efficient streaming, XStream keeps
control over the evaluation of the transformation as a whole. OCamlDuce,
instead, relies on the regular OCaml evaluation mechanism.

> So XStream cannot be used as a replacement to
> OCamlDuce. Is it correct?

Yes it is.


Regards,

Alain

Richard Jones

unread,
Jun 28, 2006, 1:21:26 PM6/28/06
to Alain Frisch, caml...@inria.fr
On Wed, Jun 28, 2006 at 05:22:57PM +0200, Alain Frisch wrote:
> This is to announce the first public release of XStream, a simple
> programming language for XML. Transformations written in XStream are
> compiled into efficient XML stream processors: the output is computed
> and produced while the input is being parsed, which makes it possible to
> run some transformations on very big XML documents which could not even
> fit in memory.

It seems interesting, but ... I downloaded the tarball and looked at
the examples and I can't tell: can XStream transform an XML file into
something else?

In particular we have a requirement to convert a huge XML file into
tabular CSV data on the fly (while the XML is being downloaded). The
XML file just consists of a very large number of <row>...</row>
records.

Rich.

--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com

Alain Frisch

unread,
Jun 29, 2006, 2:19:59 AM6/29/06
to Richard Jones, caml...@inria.fr
Richard Jones wrote:
> I downloaded the tarball and looked at
> the examples and I can't tell: can XStream transform an XML file into
> something else?
>
> In particular we have a requirement to convert a huge XML file into
> tabular CSV data on the fly (while the XML is being downloaded). The
> XML file just consists of a very large number of <row>...</row>
> records.

That's possible with XStream: text is just a special case of XML.
For instance, the following script extracts the stream of text from the
input XML stream.

main(_[x1] x2) -> concat(main(x1),main(x2))
main(%s x) -> %s main(x)
main(()) -> ()

-- Alain

0 new messages