From: James Britt Date: 2004-11-06T02:13:54+09:00 Subject: Re: [QUIZ] GEDCOM Parser (#6) Jamis Buck wrote: > > > Yup, it can. The duplication is because that's the way that the GEDCOM > spec was written. The NAME element includes the fullname as a value, > with the parts of the name specified as subelements. I imagine the spec > was done this way to make it easy to get the fullname without having to > search subtrees and concatenate values. > >> >> And why the embedded pseudo-markup in the value attribute ( e.g., the >> use of '/')? >> >> value="Jamis Gordon /Buck/" > > > Again, that's the way GEDCOM does it. I imagine it is to make it easier > to identify the surname in situations where either (a) the surname is > not given (ie, "Jamis Gordon //"), or (b) the surname consists of > multiple words (ie, "Dick /Van Dyke/"). Ah. Still, it comes off as the sort of XML people invent when they want to show why XML is hard to work with :). (As an aside, I think it's SVG or XUL that has attribute values that consist of long strings of name=value pairs. Ick. It's like taking a CSV file, wrapping it in start/end tags, and calling it XML.) Ideally, attribute values should be semantically atomic. > >> >> >> Is there a spec for this XML format, or is this deliberately tricky >> to make it more challenging? > > > No, and yes. ;) > > Honestly, if you don't like the way I've specified the values, feel free > to invent your own. I won't be hurt. I was just trying to find a way to > represent the GEDCOM-formatted data in XML, and keep the data as close > to the original as possible. I would suggest just normalizing the format, such that there is no mixed-markup or data duplication. value='some /thing/' jut looks wrong to me; leave out that attribute and using named elements for each chunk: Buck Jamis Gordon Values then are always child elements, or the text content of the element if the value does not require any additional semantic demarcation. M > > FWIW, I believe there IS a standard for representing genealogical data > in XML. But I can guarantee it will not be a one-to-one mapping between > GEDCOM to that format... I figured this would be more fun than poring > over volumes of GEDCOM and XML specifications to "get it right". Quite true. > > Just have fun with it. :) That's the important thing. Very much so! Thanks, James