[m-rev.] For review: Convert Mercury terms to XML

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Dec 6 15:29:45 AEDT 2004


On Mon, 6 Dec 2004, Ian MacLarty wrote:

> On Sun, Dec 05, 2004 at 07:34:58PM +1100, Julien Fischer wrote:
> >
> > On Sat, 4 Dec 2004, Ian MacLarty wrote:
> >
> > > For review by anyone.
> > >
> > > Estimated hours taken: 60
> > > Branches: main
> > >
> > > Add library module to convert Mercury terms to XML documents and generate DTDs
> > > for Mercury types.
> > >
> > I think that the log message could include more detail than that.
> >
> I've added the following:
>
> There is a natural mapping from Mercury terms to XML documents since both are
> tree structures.  Each functor of a Mercury type is mapped to an element name
> in the XML document.  Extra information such as the original functor name, type
> and field name are stored as attribute values.
>
A sentence or two about the intended uses of this module, e.g as part of
a term browser woudl also be helpful - otherwise thats ok.

> > > extras/xml_stylesheets/mercury_term.xsl
> > > extras/xml_stylesheets/xul_tree.xsl
> > > 	Some example stylesheets.  One to convert XML generate with the
> > > 	to_xml library to a Mercury term and one to generate a XUL
> > > 	term browser for viewing with Mozilla or Firefox.
> > >
> > You should also have a README file that explains how to use these stylesheets.
> >
> Index: extras/xml_stylesheets/README
> ===================================================================
> RCS file: extras/xml_stylesheets/README
> diff -N extras/xml_stylesheets/README
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ extras/xml_stylesheets/README	6 Dec 2004 03:40:10 -0000
> @@ -0,0 +1,17 @@
> +This directory contains some example stylesheets for use with the term_to_xml
> +library module.
> +
> +You can apply a stylesheet to an XML document using the program
> +xsltproc (available from http://xmlsoft.org/XSLT) or any other XSLT tool.  You
> +can also include a reference to the stylesheet in the XML document and have
> +your browser apply the stylesheet, although this only works with some browsers.
> +
> +mercury_term.xsl
> +	Stylesheet to convert an XML document generated with
> +	term.write_xml_doc/6 back to a Mercury term suitable for reading with
> +	io.read/3.
> +
> +xul_tree.xsl
> +	Stylesheet to convert an XML document generated with
> +	term.write_xml_doc/6 to a XUL tree structure suitable for browsing
> +	with Mozilla or Firefox.
>
s/term.write_xml_doc/term_to_xml.write_xml_doc/

> > > library/library.m
> > > 	Add to_xml.
> > >
> > > library/to_xml.m
> > > 	The to_xml module with predicates for generating XML for
> > > 	Mercury terms and DTDs for Mercury types.
> > >
> > I'm not really keen on the name `to_xml'.  How about either
> > `xml' or `xml_util'?
> >
> Everyone seems to agree on term_to_xml, so I'll use that.
>
I'm happy with that.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list