[gwp] Re: [tlewis@mindspring.net: Where in the heck is the DTD for gnumeric's file format?!? (fwd)]

Daniel Veillard (Daniel.Veillard@w3.org)
Mon, 22 Mar 1999 05:00:06 -0500

Hi all,

> Please note Todd that we are going to change the XML format used by
> Gnumeric in the future (while still being able to load old files)
> because the Printing Branch of Gnumeric has different requirements
> than the regular version.
>
> Miguel.
> ------- Start of forwarded message -------
> Date: Fri, 19 Mar 1999 10:25:36 -0500 (EST)
> From: Todd Graham Lewis <tlewis@mindspring.net>
> X-Sender: tlewis@reflections.eng.mindspring.net
> To: Miguel de Icaza <miguel@nuclecu.unam.mx>
> Subject: Where in the heck is the DTD for gnumeric's file format?!? (fwd)
> Content-Type: TEXT/PLAIN; charset=X-UNKNOWN
>
> Can you please forward this to the gnumeric list for me? I tried submitting
> it, but it is not in the archives, and so I must assume that it did not
> make it, presumably because I am not on the list.
>
> - --
> Todd Graham Lewis 32°49'N,83°36'W (800) 719-4664, x22804
> ******Linux****** MindSpring Enterprises tlewis@mindspring.net
>
> "A pint of sweat will save a gallon of blood." -- George S. Patton
>
> - ---------- Forwarded message ----------
> Date: Thu, 18 Mar 1999 19:07:39 -0500 (EST)
> From: Todd Graham Lewis <tlewis@mindspring.net>
> To: gnumeric-list@gnome.org
> Subject: Where in the heck is the DTD for gnumeric's file format?!?
>
> I am really struggling with figuring out what a gnumeric xml doc
> looks like. Where in the heck is the dtd for the darned thing? I am used
> to seeing something like:
>
> <?xml version="1.0"?>
> <!DOCTYPE advert SYSTEM "http://www.foo.org/ad.dtd">
> <advert>
> <headline>...<pic/>...</headline>
> <text>...</text>
> </advert>
> (...)
>
> in the XML FAQs and whatnot, but gnumeric just says:
>
> <?xml version="1.0"?>
> <gmr:Workbook xmlns:gmr="http://www.gnome.org/gnumeric/">
> <gmr:Geometry Width="607" Height="556"/>
> (...)
>
> Does gnumeric just dump its internal structure in XML format and trust
> that the next program to pick it up will understand the flags, complete
> with their typing, etc? I am afraid that I do not understand (as usual).

Okay, I guess I need to drop a bit of explanation here.
First, you are right, the XML produced by Gnumeric doesn't reference a
DTD. Having a DTD helps checking that the document structures conforms
to a set of rules. However, it does not help at all "understand the flags".
The semantic of an XML file cannot be coded in a DTD. For example
it possible to define that Workbook will only accept childs for type
Sheet, and that Cell are of type text. But it's impossible to express
taht for example "E3 + 12" in a Cell has the meaning of "adding content
of cell E3 and value 12".
So basically a huge amount of the semantic associated to an XML
file is still hardcoded in the application. I don't think the DTD would
really help.
But we are using namespaces, the gmr: and the xmlns definition allow
to associate any of the elements prefixed by gmr: with the URL given
in the xmlns. When upgrading to a new encoding I strongly suggest
to also add a versionning information to the namespace, e.g.
xmlns:gmr="http://www.gnome.org/gnumeric/1.1/"
and use this to dispatch the handling of those elements to the new
code.
Basically namespace could be used for a serialisation format for Bonobo
documents (if i understand the concept correctly), i.e. when embedding
a Gnumeric cell in a GWP document, the top level of the XML tree would
define the GWP document version namespace and all element related to GWP
would be prefixed by this namespace, however when dumping the content
of the embedded Gnumeric sheet, the xmlns:gmr= ... namespace definition
should be saved at the top of the subtree of the gnumeric document and
all Gnumeric element being prefixed by the gnumeric namespace prefix.
Add an infrastructure to Gnome where a service registers namespaces
per application and a standard set of CORBA interfaces for it and I
guess it would be possible to handle document composition and versionning
when serializing them to XML for storage by using namespaces in an
intelligent way.

Hope this help,

Daniel

-- 
	    [Yes, I have moved back to France !]
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux, WWW, rpmfind,
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | rpm2html, XML,
http://www.w3.org/People/W3Cpeople.html#Veillard | badminton, and Kaffe.
----
Mailing-list gwp@rufus.w3.org
To unsubscribe: echo "unsubscribe gwp" | mail majordomo@rufus.w3.org