From: "Predrag Janicic" <janicic@matf.bg.ac.yu>
To: <pedro@mat.uc.pt>,
 "Pedro Quaresma de Almeida" <phfqa@netcabo.pt>
References: <200604291321.40964.phfqa@netcabo.pt>
Subject: XML (ignore the previous message)
Date: Sun, 30 Apr 2006 23:37:24 +0200

Here comes XML stuff...
In this message I will try to give you an overview with
some examples, later we can go into details.
Sorry if I say something that you already know, please 
igore it. I am not expert for XML, so there will be a 
plenty of non-rigorous explanations in this message.

(1) What is XML?
XML is a nice, modern interchange format. It looks rather 
like HTML, but it does not have any pre-defined tags. 
If you want to use XML for your language - you have
to define your tags. However, there is a number of 
generic tools, usable for all XML-based languages.

(2) How can XML documents be shown/seen?
You can see them in Internet browser. However, in order
to see them with some nice formating, you will need an
appropriate XSLT file, designed specially for that XML
language and for showing in Internet browser.

(3) How can XML document can be converted into
some other format?
Again, by specific XSLT files. This time, not within 
Internet browser, but by using some generic tool for this.

(4) What is DTD?
It is additional file that defines a specific XML language
(something like Backus-Naur form). It can be also used
for checking if a XML file is regular.

(4) What should we represent in XML?
We should represent both constructions and proofs.
These two will require different support.

(5) Why?
Because it is nice to keep constructions in XML.
We can easily transform these representation into GCLC
or EUK format. XML is a nice basic format.
Also, it is better to keep proofs in XML than in LaTeX,
with many formatting details. If we want, we can easily
convert XML proofs into LaTeX.
For both things, it is nice that files can be nicely and
simply shown in Internet browsers.

(6) What do we need?
For descriptions of constructions, we need:
(6a) DTD that describes the language;
(6b) XSLT for showing/rendering within browsers
(6c) XSLT for showing/rendering within browsers,
but in natural-language form
(6d) XSLT for converting to GCLC
(6e) XSLT for converting to EUK

For proofs, we need:
(6f) DTD that describes the language;
(6g) XSLT for showing/rendering within browsers

On the other hand, we need:
(6h) converter from GCLC to XML
(6i) converter from EUK to XML
(6j) converter from GCLC proofs to XML

(7) What do we have as yet?
All of above (up to details and polishing), except
converter from EUK to XML.Also (6e) needs 
many checks.
(btw, note that with all this - we don't need a converter
from EUK to GCLC).

(8) What would you have to do?
Basically, you should just treat and store XML as another 
representation (as GCLC and EUK). You would render
such files by using XSLT for HTML. Also, proofs would
be simply rendered within browsers (without converting to
PostScript or something). 

(9) What is what in the attachment?
(6a) is geocons.dtd
(6b) is GeoConsHTML.xsl
(6c) is GeoConsNL.xsl
(6d) is GeoConsGCLC.xsl
(6e) is GeoConsEUK.xsl

(6f) is geocons_proof.dtd
(6g) is GeoConsProof.xsl

I developed (6h) and (6j) within GCLC. So, if you use
GCLC with the option -xml, then instead of figure you
get the input file in XML format and also proof in XML
format.
It would be nice if you can make (6i).

(10) How is all this used?

(10-1) First example:
Just open primer1.xml in your browser. It will automatically
use GeoConsHTML.xsl and will render it nicely (at least, it
should).

(10-2) Open the file primer1.xml and in the third line change 
GeoConsHTML.xsl to GeoConsNL.xsl. Then again open
it in your browser. Now the same contents should be 
rendered in terms of natural language.

(10-3) You can produce primer1.xml from primer1.gcl in 
the following way:
> gclc primer1.gcl primer1.xml -xml
(this version of gclc is attached)

(10-4) You can produce GCLC version from primer1.xml
in the following way:
>AltovaXML.exe  /xslt1 geocons.xsl /in primer1.xml /out primer1a.gcl
(you can find AltovaXML on http://www.altova.com/altovaxml.html  
However, it seems there is no Linux version, there must be 
plenty other similar programs for Linux.)

(10-5) You can produce proofs in XML format:
> gclc theorem.gcl theorem.xml -xml
You will get theorem_proof.xml. Just open it, it
should be rendered using GeoConsProof.xsl.

Etc... Let it be all for this message. What do you think?
I think this is very much worth doing. 

cheers,
Predrag