Login to participate
  
Register   Lost ID/password?
Louis Kessler’s Behold Blog » Blog Entry           prev Prev   Next next

XML is GEDCOM; GEDCOM is XML - Mon, 10 Nov 2008

My attempts to speed up the core of Behold led me to lean towards using the DISQLite3 database package. The expectation was that it would perform better than the b-tree structure I developed in prehistoric times for handling the internal data. But I may have discovered something even better.

XML (Extensible Markup Language) is a new technology developed to transport and store data. It contains start <TAGS> that are closed by ending </TAGS>. Between the start and end tags is the value associated with the tag. Tags can be nested.

Hmmm. GEDCOM looks like this:

0 @I32@ INDI
1 NAME John /Smith/
1 BIRT
2 DATE 04 MAY 1824
2 PLAC Paris, France

It has tags, values, and numbers indicating a level of nesting.

But here’s some XML:

<INDI ID=”I32″>
<NAME>John /Smith/</NAME>
<BIRT>
<DATE>04 MAY 1824</DATE>
<PLAC>Paris, France</PLAC>
</BIRT>
</INDI>

The XML is exactly :-D the same thing, as the GEDCOM.

New versions of Delphi have built-in support of XML, including support of the DOM (Document Object Model) that defines a standard way for accessing and manipulating XML documents.

What this means for Behold is that I can get it to read in the GEDCOM as XML and store it internally in memory that way for easy access while Behold is running. That will allow me to “virtualize” the ElTree treeview to use that data, and possibly also virtualize RichView to use that data (although I’m not sure if the last one is feasible yet).

Then it will be an easy matter to save the XML back to GEDCOM again. This is a great way to implement saving of GEDCOMs. It will be easy enough to do that it will now be added into the next release, rather than having to wait until Version 1.5 as I had earlier planned.

Will XML be as fast as a database, or even as fast as my current b-tree data structure? I don’t know, but when looking around for a XML implementations that may be faster than Delphi’s, I was surprised to find that LMD has an XML library, and surprise of surprises, it’s included with the LMD ElPack package that I just upgraded to.

So this is the next step, and I’ll start to implement it after a good night’s sleep.

4 Comments           comments Leave a Comment

1. uwe (uwe)
United States flag
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Tue, 11 Nov 2008  Permalink

XML a new technology? You must have been hiding somewhere in the Canadian woods, Louis… ;-)

Here is a link that might help:
http://xml.coverpages.org/genealogy.html#gedML

HTH
Uwe

2. Louis Kessler (lkessler)
Canada flag
Joined: Sun, 9 Mar 2003
287 blog comments, 245 forum posts
Posted: Tue, 11 Nov 2008  Permalink

XML 1.0 only became a W3C Recommendation in February 1998. RSS feeds became based on them. But it really took until the onset of Web 2.0 and Microsoft’s adoption of them for their default Office formats before it become something important.

I’ve known about XML’s attempted use and the to-date unsuccessful attempts to replace GEDCOM with XML versions of it. See some of the other references to XML I’ve made in the past. I did refer to the link you mentioned in my November 20, 2004 post.

But it’s newly available for me because Delphi 4 had no good hooks into it, whereas Delphi 2009 does. And I really didn’t realize that XML and GEDCOM are really the same (Duh! Hit me with a brick!) until last week.

3. uwe (uwe)
United States flag
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Tue, 11 Nov 2008  Permalink

Web designers used XML based solutions even before 2000, MSXML is around since 2003, and the same year there were already Delphi components available for both D4 and D5 (for example OmniXML or OpenXML). Adobe introduced XMP for PDF in 2001 and has since then used it in other products, too. To say that XML was not important before the onset of Web 2.0 is therefore … well … quite an exaggeration …

I didn’t want to question your expertise, by the way - I just found it funny how XML “dawned” on you.

4. Louis Kessler (lkessler)
Canada flag
Joined: Sun, 9 Mar 2003
287 blog comments, 245 forum posts
Posted: Tue, 11 Nov 2008  Permalink

Don’t worry. I enjoy these conversations.

Even today, XML has not made any significant impact in genealogy software. And you ask the average computer user about XML and they won’t know what you’re talking about. In fact most web developers don’t know the difference between HTML and XML.

And I don’t say that it wasn’t important. It just wasn’t in general use, especially not the way it is starting to be used in the last few years.

Until last week, I never had connected using XML for GEDCOM. I didn’t know enough about it to realize that it wasn’t just another data definition language. It only came back into my thinking again while reading one of the new Delphi books I purchased which had a chapter on it.

But it’s still not easy. There are many ways to implement it, and which way if any is best for Behold is still not clear to me. Hopefully, it will be soon.

Leave a Comment

You must login to comment.

Login to participate
  
Register   Lost ID/password?