Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: [QUIZ] GEDCOM Parser (#6
Jamis Buck
11/5/2004 4:34:00 PM
James Britt wrote:
> Jamis Buck wrote:
>
>>
>> Yup, that was the rule. If a node has children, it's value should be
>> an attribute. Otherwise, it's value should be a sub-element.
>
>
> Why?
>
> In this example
>
> <name value="Jamis Gordon /Buck/">
> <surn>Buck</surn>
> <givn>Jamis Gordon</givn>
> </name>
>
> it appears that the value attribute can be derived from the immediate
> children. Or vice versa. Why the duplication?
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/").
>
>
> 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.
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".
Just have fun with it. :) That's the important thing.
>
>
> James
>
- Jamis
--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: [QUIZ] GEDCOM Parser (#6
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password