GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
Reading Marriages from XML file in Java


https://support.genopro.com/Topic25427.aspx
Print Topic | Close Window

By tdebuys - Thursday, February 11, 2010
Hi all,

I am trying to read the data.xml file with Java and want to list marriages from the file.

For example:

X married Y on Z.

Can someone please explain how, walking through the tag to link to the two parties involved?

Thanks
By genome - Friday, February 12, 2010
Take a look at the simple case of xml for a single family with a marriage

<Individuals>
<Individual ID="ind00001">
  <Name>husband
    <Display>husband</Display>
    <First>husband</First>
  </Name>
  <Position BoundaryRect="-59,176,-1,117">-30,150</Position>
  <Gender>M</Gender>
</Individual>
<Individual ID="ind00002">
  <Name>wife
    <Display>wife</Display>
    <First>wife</First>
  </Name>
  <Position BoundaryRect="104,176,156,117">130,150</Position>
  <Gender>F</Gender>
</Individual>
</Individuals>
<Families>
<Family ID="fam00001">
  <Unions>marr00001</Unions>
</Family>
</Families>
<Marriages>
<Marriage ID="marr00001">
  <Date>12 Feb 2010</Date>
</Marriage>
</Marriages>
<PedigreeLinks>
<PedigreeLink PedigreeLink="Parent" Family="fam00001" Individual="ind00001"/>
<PedigreeLink PedigreeLink="Parent" Family="fam00001" Individual="ind00002"/>
</PedigreeLinks>

For marriages you need to all Family tags that have a Unions sub tag. Use the contents of the Unions tag, e.g. marr00001 above, to find the related Marriage tag and get the Date. (Note that there can be more than one Marriage ID in the Unions tag, separated by commas). Using the ID attribute value of each Family find associated PedigreeLinks with a corresponding Family attribute (e.g. fam00001 in the above). From these use the Individual attributes to get the partners of the family/marriage, getting their names from the Name tags of the associated Individuals.

By tdebuys - Wednesday, February 17, 2010
Hi there,

Thank you Ron, your reply was exactly what I needed.

I have written a Java console application which, given a .gno file, will list births, baptisms, marriages, deaths, burials and cremations which occurred on today's date. Sort of like a "Today in history".

I'm willing to email the app to who ever wants to use it?
Please email me directly should you want a copy of it. It's not very big.

Regards