Parse and process cross-references.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 5 Jan 2002 14:05:11 +0000 (14:05 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 5 Jan 2002 14:05:11 +0000 (14:05 +0000)
doc/interface.html
gedcom/Makefile.am
gedcom/gedcom.y
gedcom/interface.c
gedcom/multilex.c
gedcom/xref.c [new file with mode: 0644]
gedcom/xref.h [new file with mode: 0644]
include/gedcom.h
standalone.c

index 057a31eddd18e3070581e024b0e236507cede5fc..aab82218eefec08564d2fec05f488dfb5d453bb9 100644 (file)
 <html>
 <head>
   <title>Libgedcom interface details</title>
-                           
+                                  
   <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
 </head>
   <body>
-       
+         
 <h1 align="center">Libgedcom interface details</h1>
-    <br>
-       
+     <br>
+         
 <h2>Index</h2>
-       
+         
 <ul>
-      <li><a href="#Record_identifiers">Record identifiers</a></li>
-      <li><a href="#Element_identifiers">Element identifiers</a></li>
-      <li><a href="#Gedcom_val_types">Gedcom_val types</a></li>
-           
+       <li><a href="#Record_identifiers">Record identifiers</a></li>
+       <li><a href="#Element_identifiers">Element identifiers</a></li>
+       <li><a href="#Gedcom_val_types">Gedcom_val types</a></li>
+               
   <ul>
-       <li><a href="#struct_date_value">struct date_value</a></li>
-       <li><a href="#struct_date">struct date</a><br>
-      </li>
-           
+        <li><a href="#struct_date_value">struct date_value</a></li>
+        <li><a href="#struct_date">struct date</a></li>
+    <li><a href="#struct_xref_value">struct xref_value</a><br>
+       </li>
+               
   </ul>
-       
+         
 </ul>
-    <br>
-       
-<hr width="100%" size="2">    
+     <br>
+         
+<hr width="100%" size="2">     
 <h2><a name="Record_identifiers"></a>Record identifiers</h2>
-    The following table describes the identifiers to be used in the record
- callbacks.  &nbsp;The last column gives the <a href="#Gedcom_val_types"><code>
-  Gedcom_val</code>   type</a> of the <code>xref</code> argument in the header
- start callback.<br>
+     The following table describes the identifiers to be used in the record 
+ callbacks.  &nbsp;The last columns gives the <a href="#Gedcom_val_types"><code>
+   Gedcom_val</code>   type</a> of the <code>xref</code> and&nbsp;<code>val</code><code>
+</code> arguments in the header  start callback.<br>
+     <br>
+         
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+       <tbody>
+         <tr>
+           <td valign="top" align="center"><b>Record</b><br>
+           </td>
+           <td valign="top" align="center"><b>Meaning</b><br>
+           </td>
+           <td valign="top" align="center"><b>Possible<br>
+     &nbsp;<code>xref</code> types</b><br>
+           </td>
+      <td valign="top" align="center"><b>Possible<br>
+      <code>val</code> types<br>
+      </b><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_HEAD</code><br>
+           </td>
+           <td valign="top">The header of the GEDCOM file<br>
+           </td>
+           <td valign="top"><code>NULL</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_FAM</code><br>
+           </td>
+           <td valign="top">A record describing a family<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(FAM)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_INDI</code><br>
+           </td>
+           <td valign="top">A record describing an individual<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(INDI)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_OBJE</code><br>
+           </td>
+           <td valign="top">A record describing a multimedia object<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(OBJE)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_NOTE</code><br>
+           </td>
+           <td valign="top">A record describing a note<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(NOTE)</code><br>
+           </td>
+      <td valign="top"><code>STRING</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_REPO</code><br>
+           </td>
+           <td valign="top">A record describing a source repository<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(REPO)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_SOUR</code><br>
+           </td>
+           <td valign="top">A record describing a source<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(SOUR)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_SUBN</code><br>
+           </td>
+           <td valign="top">A record describing the submission<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(SUBN)</code><br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_SUBM</code><br>
+           </td>
+           <td valign="top">A record describing the submitter<br>
+           </td>
+           <td valign="top"><code>XREF_PTR(SUBM</code>)<br>
+           </td>
+      <td valign="top"><code>NULL</code><br>
+      </td>
+         </tr>
+         <tr>
+           <td valign="top"><code>REC_USER</code><br>
+           </td>
+           <td valign="top">An application-specific record (the <code>tag</code>
+      in the start callback contains the actually used tag).<br>
+           </td>
+           <td valign="top"><code>NULL<br>
+XREF_PTR(USER)<br>
+      </code><br>
+           </td>
+      <td valign="top"><code>NULL<br>
+STRING<br>
+XREF_PTR(USER)</code><br>
+      </td>
+         </tr>
+                   
+  </tbody>     
+</table>
+         
+<hr width="100%" size="2">     
+<h2><a name="Element_identifiers"></a>Element identifiers</h2>
+    The following table describes the identifiers to be used in the element 
+ callbacks. &nbsp;The last column gives the <a href="file:///home/verthezp/src/external/gedcom-parse/doc/interface.html#Gedcom_val_types"><code>
+    Gedcom_val</code>  type</a> of the <code>val</code> argument in the element
+  start callback.<br>
     <br>
        
-<table width="100%" border="1" cellspacing="2" cellpadding="2">
+<table cellpadding="2" cellspacing="2" border="1" width="100%">
       <tbody>
         <tr>
-          <td valign="top" align="center"><b>Record</b><br>
+          <td valign="top" align="center"><b>Element</b><br>
+          </td>
+          <td valign="top" align="center"><b>Possible<br>
+    tags<br>
+          </b><br>
+          </td>
+          <td valign="top" align="center"><b>Used within</b><br>
+          </td>
+          <td valign="top" align="center"><b>Possible<br>
+          <code>val</code> types<br>
+          </b><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR</code><br>
+          </td>
+          <td valign="top"><code>SOUR</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_VERS</code><br>
+          </td>
+          <td valign="top"><code>VERS</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_NAME</code><br>
+          </td>
+          <td valign="top"><code>NAME</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_CORP</code><br>
+          </td>
+          <td valign="top"><code>CORP</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>DATA</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_DATA_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SOUR_DATA_COPR</code><br>
+          </td>
+          <td valign="top"><code>COPR</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_DEST</code><br>
+          </td>
+          <td valign="top"><code>DEST</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_DATE_TIME</code><br>
+          </td>
+          <td valign="top"><code>TIME</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_DATE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SUBM</code><br>
+          </td>
+          <td valign="top"><code>SUBM</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_SUBN</code><br>
+          </td>
+          <td valign="top"><code>SUBN</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBN)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_FILE</code><br>
+          </td>
+          <td valign="top"><code>FILE</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_COPR</code><br>
+          </td>
+          <td valign="top"><code>COPR</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_GEDC</code><br>
+          </td>
+          <td valign="top"><code>GEDC</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_GEDC_VERS</code><br>
+          </td>
+          <td valign="top"><code>VERS</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_GEDC</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_GEDC_FORM</code><br>
+          </td>
+          <td valign="top"><code>FORM</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_GEDC</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_CHAR</code><br>
+          </td>
+          <td valign="top"><code>CHAR</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_CHAR_VERS</code><br>
+          </td>
+          <td valign="top"><code>VERS</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_CHAR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_LANG</code><br>
+          </td>
+          <td valign="top"><code>LANG</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_PLAC</code><br>
+          </td>
+          <td valign="top"><code>PLAC</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_PLAC_FORM</code><br>
+          </td>
+          <td valign="top"><code>FORM</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_PLAC</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_HEAD_NOTE</code><br>
+          </td>
+          <td valign="top"><code>NOTE</code><br>
+          </td>
+          <td valign="top"><code>REC_HEAD</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_FAM_HUSB</code><br>
+          </td>
+          <td valign="top"><code>HUSB</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(INDI)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_FAM_WIFE</code><br>
+          </td>
+          <td valign="top"><code>WIFE</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(INDI)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_FAM_CHIL</code><br>
+          </td>
+          <td valign="top"><code>CHIL</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(INDI)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_FAM_NCHI</code><br>
+          </td>
+          <td valign="top"><code>NCHI</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_FAM_SUBM</code><br>
+          </td>
+          <td valign="top"><code>SUBM</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_RESN</code><br>
+          </td>
+          <td valign="top"><code>RES</code><code>N</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_SEX</code><br>
+          </td>
+          <td valign="top"><code>SEX</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_SUBM</code><br>
+          </td>
+          <td valign="top"><code>SUBM</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_ALIA</code><br>
+          </td>
+          <td valign="top"><code>ALIA</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(INDI)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_ANCI</code><br>
+          </td>
+          <td valign="top"><code>ANCI</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_DESI</code><br>
+          </td>
+          <td valign="top"><code>DESI</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_RFN</code><br>
+          </td>
+          <td valign="top"><code>RFN</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_INDI_AFN</code><br>
+          </td>
+          <td valign="top"><code>AFN</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_OBJE_FORM</code><br>
+          </td>
+          <td valign="top"><code>FORM</code><br>
+          </td>
+          <td valign="top"><code>REC_OBJE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_OBJE_TITL</code><br>
+          </td>
+          <td valign="top"><code>TITL</code><br>
+          </td>
+          <td valign="top"><code>REC_OBJE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_OBJE_BLOB</code><br>
+          </td>
+          <td valign="top"><code>BLOB</code><br>
+          </td>
+          <td valign="top"><code>REC_OBJE</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_OBJE_BLOB_CONT</code><br>
+          </td>
+          <td valign="top"><code>CONT</code><br>
+          </td>
+          <td valign="top"><code>ELT_OBJE_BLOB</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_OBJE_OBJE</code><br>
+          </td>
+          <td valign="top"><code>OBJE</code><br>
+          </td>
+          <td valign="top"><code>REC_OBJE</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(OBJE)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_REPO_NAME</code><br>
+          </td>
+          <td valign="top"><code>NAME</code><br>
+          </td>
+          <td valign="top"><code>REC_REPO</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>DATA</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
+          </td>
+          <td valign="top"><code>EVEN</code><br>
+          </td>
+          <td valign="top"><code>ELT_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_DATA_EVEN_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_DATA_EVEN_PLAC</code><br>
+          </td>
+          <td valign="top"><code>PLAC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_DATA_AGNC</code><br>
+          </td>
+          <td valign="top"><code>AGNC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_AUTH</code><br>
+          </td>
+          <td valign="top"><code>AUTH</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_TITL</code><br>
+          </td>
+          <td valign="top"><code>TITL</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_ABBR</code><br>
+          </td>
+          <td valign="top"><code>ABBR</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_PUBL</code><br>
+          </td>
+          <td valign="top"><code>PUBL</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SOUR_TEXT</code><br>
+          </td>
+          <td valign="top"><code>TEXT</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_SUBM</code><br>
+          </td>
+          <td valign="top"><code>SUBM</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(SUBM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_FAMF</code><br>
+          </td>
+          <td valign="top"><code>FAMF</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_TEMP</code><br>
+          </td>
+          <td valign="top"><code>TEMP</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_ANCE</code><br>
+          </td>
+          <td valign="top"><code>ANCE</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_DESC</code><br>
+          </td>
+          <td valign="top"><code>DESC</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_ORDI</code><br>
+          </td>
+          <td valign="top"><code>ORDI</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBN_RIN</code><br>
+          </td>
+          <td valign="top"><code>RIN</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBM_NAME</code><br>
+          </td>
+          <td valign="top"><nobr><code>NAME</code></nobr><br>
+          </td>
+          <td valign="top"><code>REC_SUBM</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBM_LANG</code><br>
+          </td>
+          <td valign="top"><code>LANG</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBM</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBM_RFN</code><br>
+          </td>
+          <td valign="top"><code>RFN</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBM</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUBM_RIN</code><br>
+          </td>
+          <td valign="top"><code>RIN</code><br>
+          </td>
+          <td valign="top"><code>REC_SUBM</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>ADDR</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR_CORP,<br>
+   REC_REPO, REC_SUBM,<br>
+         </code><code>ELT_SUB_FAM_EVT</code>,<br>
+         <code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI,<br>
+   ELT_SUB_INDIV_BIRT,<br>
+   ELT_SUB_INDIV_GEN,<br>
+   ELT_SUB_INDIV_ADOP<br>
+         </code><br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_CONT</code><br>
+          </td>
+          <td valign="top"><code>CONT</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_ADR1</code><br>
+          </td>
+          <td valign="top"><code>ADR1</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_ADR2</code><br>
+          </td>
+          <td valign="top"><code>ADR2</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_CITY</code><br>
+          </td>
+          <td valign="top"><code>CITY</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_STAE</code><br>
+          </td>
+          <td valign="top"><code>STAE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_POST</code><br>
+          </td>
+          <td valign="top"><code>POST</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ADDR_CTRY</code><br>
+          </td>
+          <td valign="top"><code>CTRY</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ADDR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_PHON</code><br>
+          </td>
+          <td valign="top"><code>PHON</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_SOUR_CORP,<br>
+   REC_REPO, REC_SUBM,<br>
+         </code><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI,<br>
+   ELT_SUB_INDIV_BIRT,<br>
+   ELT_SUB_INDIV_GEN,<br>
+   ELT_SUB_INDIV_ADOP<br>
+         </code><br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ASSO</code><br>
+          </td>
+          <td valign="top"><code>ASSO</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(INDI)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ASSO_TYPE</code><br>
+          </td>
+          <td valign="top"><code>TYPE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ASSO</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_ASSO_RELA</code><br>
+          </td>
+          <td valign="top"><code>RELA</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_ASSO</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_CHAN</code><br>
+          </td>
+          <td valign="top"><code>CHAN</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_OBJE, REC_NOTE,<br>
+   REC_REPO, REC_SOUR,<br>
+   REC_SUBM<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_CHAN_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_CHAN</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_CHAN_TIME</code><br>
+          </td>
+          <td valign="top"><code>TIME</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_CHAN_DATE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAMC</code><br>
+          </td>
+          <td valign="top"><code>FAMC</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(FAM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAMC_PEDI</code><br>
+          </td>
+          <td valign="top"><code>PEDI</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAMC</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_CONT</code><br>
+          </td>
+          <td valign="top"><code>CONT</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_NOTE, REC_NOTE,<br>
+   ELT_SOUR_AUTH, ELT_SOUR_TITL,<br>
+   ELT_SOUR_PUBL, ELT_SOUR_TEXT,<br>
+   ELT_SUB_NOTE, <br>
+   ELT_SUB_SOUR, ELT_SUB_SOUR_TEXT<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_CONC</code><br>
+          </td>
+          <td valign="top"><code>CONC</code><br>
+          </td>
+          <td valign="top"><code>ELT_HEAD_NOTE, REC_NOTE,<br>
+   ELT_SOUR_AUTH, ELT_SOUR_TITL,<br>
+   ELT_SOUR_PUBL, ELT_SOUR_TEXT,<br>
+   ELT_SUB_NOTE, <br>
+   ELT_SUB_SOUR, ELT_SUB_SOUR_TEXT<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_EVT_TYPE</code><br>
+          </td>
+          <td valign="top"><code>TYPE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI,<br>
+   ELT_SUB_INDIV_BIRT,<br>
+   ELT_SUB_INDIV_GEN,<br>
+   ELT_SUB_INDIV_ADOP<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_EVT_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
+         <code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR</code><code>,<br>
+    ELT_SUB_INDIV_RESI,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP<br>
+         </code><br>
+         <br>
+         <br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_EVT_AGE</code><br>
+          </td>
+          <td valign="top"><code>AGE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP</code><br>
+         <br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_EVT_AGNC</code><br>
+          </td>
+          <td valign="top"><code>AGNC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP</code><br>
+         <br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_EVT_CAUS</code><br>
+          </td>
+          <td valign="top"><code>CAUS</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP</code><br>
+         <br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAM_EVT</code><br>
+          </td>
+          <td valign="top"><code>ANUL, CENS, DIV,<br>
+    DIVF, ENGA, MARR,<br>
+    MARB, MARC, MARL,<br>
+    MARS</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAM_EVT_HUSB</code><br>
+          </td>
+          <td valign="top"><code>HUSB</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
+         <code>ELT_SUB_FAM_EVT_EVEN</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAM_EVT_WIFE</code><br>
+          </td>
+          <td valign="top"><code>WIFE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
+         <code>ELT_SUB_FAM_EVT_EVEN</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAM_EVT_AGE</code><br>
+          </td>
+          <td valign="top"><code>AGE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT_HUSB</code>,<br>
+         <code>ELT_SUB_FAM_EVT_WIFE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAM_EVT_EVEN</code><br>
+          </td>
+          <td valign="top"><code>EVEN</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_IDENT_REFN</code><br>
+          </td>
+          <td valign="top"><code>REFN</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_OBJE, REC_NOTE,<br>
+   REC_REPO, REC_SOUR<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_IDENT_REFN_TYPE</code><br>
+          </td>
+          <td valign="top"><code>TYPE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_IDENT_REFN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_IDENT_RIN</code><br>
+          </td>
+          <td valign="top"><code>RIN</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_OBJE, REC_NOTE,<br>
+   REC_REPO, REC_SOUR<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_ATTR</code><br>
+          </td>
+          <td valign="top"><code>CAST, DSCR, EDUC,<br>
+    IDNO, NATI, NCHR,<br>
+    NMR, OCCU, PROP,<br>
+    RELI, SSN, TITL</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_RESI</code><br>
+          </td>
+          <td valign="top"><code>RESI</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_BIRT</code><br>
+          </td>
+          <td valign="top"><code>BIRT, CHR</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_BIRT_FAMC</code><br>
+          </td>
+          <td valign="top"><code>FAMC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_INDIV_BIRT</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(FAM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_GEN</code><br>
+          </td>
+          <td valign="top"><code>DEAT, BURI, CREM,<br>
+    BAPM, BARM, BASM,<br>
+    BLES, CHRA, CONF,<br>
+    FCOM, ORDN, NATU,<br>
+    EMIG, IMMI, CENS,<br>
+    PROB, WILL, GRAD,<br>
+    RETI</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_ADOP</code><br>
+          </td>
+          <td valign="top"><code>ADOP</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC</code><br>
+          </td>
+          <td valign="top"><code>FAMC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_INDIV_ADOP</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(FAM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC_ADOP</code><br>
+          </td>
+          <td valign="top"><code>ADOP</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_INDIV_EVEN</code><br>
+          </td>
+          <td valign="top"><code>EVEN</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL</code><br>
+          </td>
+          <td valign="top"><code>BAPL, CONL, ENDL</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL_STAT</code><br>
+          </td>
+          <td valign="top"><code>STAT</code><br>
+          </td>
+          <td valign="top"><code></code><code>ELT_SUB_LIO_BAPL,<br>
+   ELT_SUB_LIO_SLGC<br>
+         </code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
+    ELT_SUB_LIO_SLGC<br>
+         </code><br>
+         <br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL_TEMP</code><br>
+          </td>
+          <td valign="top"><code>TEMP</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
+    ELT_SUB_LIO_SLGC<br>
+         </code><br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL_PLAC</code><br>
+          </td>
+          <td valign="top"><code>PLAC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
+    ELT_SUB_LIO_SLGC<br>
+         </code><br>
+         <br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_SLGC</code><br>
+          </td>
+          <td valign="top"><code>SLGC</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LIO_SLGC_FAMC</code><br>
+          </td>
+          <td valign="top"><code>FAMC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LIO_SLGC</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(FAM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
+          </td>
+          <td valign="top"><code>SLGS</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM</code><br>
+          </td>
+          <td valign="top"><code>NULL</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS_STAT</code><br>
+          </td>
+          <td valign="top"><code>STAT</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS_TEMP</code><br>
+          </td>
+          <td valign="top"><code>TEMP</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS_PLAC</code><br>
+          </td>
+          <td valign="top"><code>PLAC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
+          </td>
+          <td valign="top"><code>OBJE</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_SOUR, REC_SUBM,<br>
+         </code><code>ELT_SUB_FAM_EVT,<br>
+   ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP,<br>
+   ELT_SUB_SOUR</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+XREF_PTR(OBJE)<br>
+      </code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE_FORM</code><br>
+          </td>
+          <td valign="top"><code>FORM</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE_TITL</code><br>
+          </td>
+          <td valign="top"><code>TITL</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE_FILE</code><br>
+          </td>
+          <td valign="top"><code>FILE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_NOTE</code><br>
           </td>
-          <td valign="top" align="center"><b>Meaning</b><br>
+          <td valign="top"><code>NOTE</code><br>
           </td>
-          <td valign="top" align="center"><b>Possible<br>
-    &nbsp;<code>xref</code> types</b><br>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_OBJE, REC_REPO,<br>
+   REC_SOUR, ELT_SOUR_DATA,<br>
+   ELT_SUB_ASSO, ELT_SUB_CHAN,<br>
+   ELT_SUB_FAMC, </code><code>ELT_SUB_FAM_EVT,<br>
+   ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP,<br>
+   ELT_SUB_LIO_BAPL,<br>
+   ELT_SUB_LIO_SLGC,<br>
+   ELT_SUB_LSS_SLGS,<br>
+   ELT_SUB_MULTIM_OBJE,<br>
+   ELT_SUB_PERS_NAME,<br>
+   ELT_SUB_PLAC,<br>
+   ELT_SUB_SOUR,<br>
+   ELT_SUB_REPO,<br>
+   ELT_SUB_FAMS</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING<br>
+XREF_PTR(NOTE)<br>
+      </code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_HEAD</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
-          <td valign="top">The header of the GEDCOM file<br>
+          <td valign="top"><code>NAME</code><br>
           </td>
-          <td valign="top"><code>NULL</code><br>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_FAM</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_NPFX</code><br>
           </td>
-          <td valign="top">A record describing a family<br>
+          <td valign="top"><code>NPFX</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_INDI</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_GIVN</code><br>
           </td>
-          <td valign="top">A record describing an individual<br>
+          <td valign="top"><code>GIVN</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_OBJE</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_NICK</code><br>
+          </td>
+          <td valign="top"><code>NICK</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
-          <td valign="top">A record describing a multimedia object<br>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_SPFX</code><br>
+          </td>
+          <td valign="top"><code>SPFX</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_NOTE</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_SURN</code><br>
           </td>
-          <td valign="top">A record describing a note<br>
+          <td valign="top"><code>SURN</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_REPO</code><br>
+          <td valign="top"><code>ELT_SUB_PERS_NAME_NSFX</code><br>
           </td>
-          <td valign="top">A record describing a source repository<br>
+          <td valign="top"><code>NSFX</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_SOUR</code><br>
+          <td valign="top"><code>ELT_SUB_PLAC</code><br>
           </td>
-          <td valign="top">A record describing a source<br>
+          <td valign="top"><code>PLAC</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
+         <code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_SUBN</code><br>
+          <td valign="top"><code>ELT_SUB_PLAC_FORM</code><br>
           </td>
-          <td valign="top">A record describing the submission<br>
+          <td valign="top"><code>FORM</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_PLAC</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_SUBM</code><br>
+          <td valign="top"><code>ELT_SUB_SOUR</code><br>
+          </td>
+          <td valign="top"><code>SOUR</code><br>
+          </td>
+          <td valign="top"><code>REC_FAM, REC_INDI,<br>
+   REC_NOTE, ELT_SUB_ASSO<br>
+         </code><code>ELT_SUB_FAM_EVT,<br>
+         </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
+   ELT_SUB_INDIV_ATTR,<br>
+   ELT_SUB_INDIV_RESI</code><code>,<br>
+    ELT_SUB_INDIV_BIRT,<br>
+    ELT_SUB_INDIV_GEN,<br>
+    ELT_SUB_INDIV_ADOP,<br>
+   ELT_SUB_LIO_BAPL,<br>
+   ELT_SUB_LIO_SLGC,<br>
+   ELT_SUB_LSS_SLGS,<br>
+   ELT_SUB_NOTE,<br>
+   ELT_SUB_PERS_NAME,<br>
+   ELT_SUB_PLAC</code><br>
           </td>
-          <td valign="top">A record describing the submitter<br>
+          <td valign="top"><code>STRING<br>
+XREF_PTR(SOUR)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_PAGE</code><br>
+          </td>
+          <td valign="top"><code>PAGE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_EVEN</code><br>
+          </td>
+          <td valign="top"><code>EVEN</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_EVEN_ROLE</code><br>
+          </td>
+          <td valign="top"><code>ROLE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR_EVEN</code><br>
           </td>
           <td valign="top"><code>STRING</code><br>
           </td>
         </tr>
         <tr>
-          <td valign="top"><code>REC_USER</code><br>
+          <td valign="top"><code>ELT_SUB_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>DATA</code><br>
           </td>
-          <td valign="top">An application-specific record (the <code>tag</code>
-     in the start callback contains the actually used tag).<br>
+          <td valign="top"><code>ELT_SUB_SOUR</code><br>
           </td>
           <td valign="top"><code>NULL</code><br>
-    <code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_DATA_DATE</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>DATE</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_TEXT</code><br>
+          </td>
+          <td valign="top"><code>TEXT</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR<br>
+   ELT_SUB_SOUR_DATA</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_SOUR_QUAY</code><br>
+          </td>
+          <td valign="top"><code>QUAY</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_SOUR</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_REPO</code><br>
+          </td>
+          <td valign="top"><code>REPO</code><br>
+          </td>
+          <td valign="top"><code>REC_SOUR</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(REPO)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_REPO_CALN</code><br>
+          </td>
+          <td valign="top"><code>CALN</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_REPO</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_REPO_CALN_MEDI</code><br>
+          </td>
+          <td valign="top"><code>MEDI</code><br>
+          </td>
+          <td valign="top"><code>ELT_SUB_REPO_CALN</code><br>
+          </td>
+          <td valign="top"><code>STRING</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_SUB_FAMS</code><br>
+          </td>
+          <td valign="top"><code>FAMS</code><br>
+          </td>
+          <td valign="top"><code>REC_INDI</code><br>
+          </td>
+          <td valign="top"><code>XREF_PTR(FAM)</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top"><code>ELT_USER</code><br>
+          </td>
+          <td valign="top"><code>any tag starting<br>
+    with an underscore</code><br>
+          </td>
+          <td valign="top"><code>anywhere</code><br>
+          </td>
+          <td valign="top"><code>NULL<br>
+    STRING<br>
+XREF_PTR(USER)</code><br>
           </td>
         </tr>
                
   </tbody>    
 </table>
-       
-<hr width="100%" size="2">    
-<h2><a name="Element_identifiers"></a>Element identifiers</h2>
-   The following table describes the identifiers to be used in the element
- callbacks. &nbsp;The last column gives the <a href="file:///home/verthezp/src/external/gedcom-parse/doc/interface.html#Gedcom_val_types"><code>
-   Gedcom_val</code>  type</a> of the <code>val</code> argument in the element 
- start callback.<br>
-   <br>
-     
-<table cellpadding="2" cellspacing="2" border="1" width="100%">
-     <tbody>
-       <tr>
-         <td valign="top" align="center"><b>Element</b><br>
-         </td>
-         <td valign="top" align="center"><b>Possible<br>
-   tags<br>
-         </b><br>
-         </td>
-         <td valign="top" align="center"><b>Used within</b><br>
-         </td>
-         <td valign="top" align="center"><b>Possible<br>
-         <code>val</code> types<br>
-         </b><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR</code><br>
-         </td>
-         <td valign="top"><code>SOUR</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_VERS</code><br>
-         </td>
-         <td valign="top"><code>VERS</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_NAME</code><br>
-         </td>
-         <td valign="top"><code>NAME</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_CORP</code><br>
-         </td>
-         <td valign="top"><code>CORP</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>DATA</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_DATA_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SOUR_DATA_COPR</code><br>
-         </td>
-         <td valign="top"><code>COPR</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_DEST</code><br>
-         </td>
-         <td valign="top"><code>DEST</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_DATE_TIME</code><br>
-         </td>
-         <td valign="top"><code>TIME</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_DATE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SUBM</code><br>
-         </td>
-         <td valign="top"><code>SUBM</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_SUBN</code><br>
-         </td>
-         <td valign="top"><code>SUBN</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_FILE</code><br>
-         </td>
-         <td valign="top"><code>FILE</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_COPR</code><br>
-         </td>
-         <td valign="top"><code>COPR</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_GEDC</code><br>
-         </td>
-         <td valign="top"><code>GEDC</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_GEDC_VERS</code><br>
-         </td>
-         <td valign="top"><code>VERS</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_GEDC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_GEDC_FORM</code><br>
-         </td>
-         <td valign="top"><code>FORM</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_GEDC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_CHAR</code><br>
-         </td>
-         <td valign="top"><code>CHAR</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_CHAR_VERS</code><br>
-         </td>
-         <td valign="top"><code>VERS</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_CHAR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_LANG</code><br>
-         </td>
-         <td valign="top"><code>LANG</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_PLAC</code><br>
-         </td>
-         <td valign="top"><code>PLAC</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_PLAC_FORM</code><br>
-         </td>
-         <td valign="top"><code>FORM</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_PLAC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_HEAD_NOTE</code><br>
-         </td>
-         <td valign="top"><code>NOTE</code><br>
-         </td>
-         <td valign="top"><code>REC_HEAD</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_FAM_HUSB</code><br>
-         </td>
-         <td valign="top"><code>HUSB</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_FAM_WIFE</code><br>
-         </td>
-         <td valign="top"><code>WIFE</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_FAM_CHIL</code><br>
-         </td>
-         <td valign="top"><code>CHIL</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_FAM_NCHI</code><br>
-         </td>
-         <td valign="top"><code>NCHI</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_FAM_SUBM</code><br>
-         </td>
-         <td valign="top"><code>SUBM</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_RESN</code><br>
-         </td>
-         <td valign="top"><code>RES</code><code>N</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_SEX</code><br>
-         </td>
-         <td valign="top"><code>SEX</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_SUBM</code><br>
-         </td>
-         <td valign="top"><code>SUBM</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_ALIA</code><br>
-         </td>
-         <td valign="top"><code>ALIA</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_ANCI</code><br>
-         </td>
-         <td valign="top"><code>ANCI</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_DESI</code><br>
-         </td>
-         <td valign="top"><code>DESI</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_RFN</code><br>
-         </td>
-         <td valign="top"><code>RFN</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_INDI_AFN</code><br>
-         </td>
-         <td valign="top"><code>AFN</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_OBJE_FORM</code><br>
-         </td>
-         <td valign="top"><code>FORM</code><br>
-         </td>
-         <td valign="top"><code>REC_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_OBJE_TITL</code><br>
-         </td>
-         <td valign="top"><code>TITL</code><br>
-         </td>
-         <td valign="top"><code>REC_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_OBJE_BLOB</code><br>
-         </td>
-         <td valign="top"><code>BLOB</code><br>
-         </td>
-         <td valign="top"><code>REC_OBJE</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_OBJE_BLOB_CONT</code><br>
-         </td>
-         <td valign="top"><code>CONT</code><br>
-         </td>
-         <td valign="top"><code>ELT_OBJE_BLOB</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_OBJE_OBJE</code><br>
-         </td>
-         <td valign="top"><code>OBJE</code><br>
-         </td>
-         <td valign="top"><code>REC_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_REPO_NAME</code><br>
-         </td>
-         <td valign="top"><code>NAME</code><br>
-         </td>
-         <td valign="top"><code>REC_REPO</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>DATA</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
-         </td>
-         <td valign="top"><code>EVEN</code><br>
-         </td>
-         <td valign="top"><code>ELT_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_DATA_EVEN_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_DATA_EVEN_PLAC</code><br>
-         </td>
-         <td valign="top"><code>PLAC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SOUR_DATA_EVEN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_DATA_AGNC</code><br>
-         </td>
-         <td valign="top"><code>AGNC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_AUTH</code><br>
-         </td>
-         <td valign="top"><code>AUTH</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_TITL</code><br>
-         </td>
-         <td valign="top"><code>TITL</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_ABBR</code><br>
-         </td>
-         <td valign="top"><code>ABBR</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_PUBL</code><br>
-         </td>
-         <td valign="top"><code>PUBL</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SOUR_TEXT</code><br>
-         </td>
-         <td valign="top"><code>TEXT</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_SUBM</code><br>
-         </td>
-         <td valign="top"><code>SUBM</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_FAMF</code><br>
-         </td>
-         <td valign="top"><code>FAMF</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_TEMP</code><br>
-         </td>
-         <td valign="top"><code>TEMP</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_ANCE</code><br>
-         </td>
-         <td valign="top"><code>ANCE</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_DESC</code><br>
-         </td>
-         <td valign="top"><code>DESC</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_ORDI</code><br>
-         </td>
-         <td valign="top"><code>ORDI</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBN_RIN</code><br>
-         </td>
-         <td valign="top"><code>RIN</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBM_NAME</code><br>
-         </td>
-         <td valign="top"><nobr><code>NAME</code></nobr><br>
-         </td>
-         <td valign="top"><code>REC_SUBM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBM_LANG</code><br>
-         </td>
-         <td valign="top"><code>LANG</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBM_RFN</code><br>
-         </td>
-         <td valign="top"><code>RFN</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUBM_RIN</code><br>
-         </td>
-         <td valign="top"><code>RIN</code><br>
-         </td>
-         <td valign="top"><code>REC_SUBM</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>ADDR</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR_CORP,<br>
-  REC_REPO, REC_SUBM,<br>
-        </code><code>ELT_SUB_FAM_EVT</code>,<br>
-        <code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI,<br>
-  ELT_SUB_INDIV_BIRT,<br>
-  ELT_SUB_INDIV_GEN,<br>
-  ELT_SUB_INDIV_ADOP<br>
-        </code><br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_CONT</code><br>
-         </td>
-         <td valign="top"><code>CONT</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_ADR1</code><br>
-         </td>
-         <td valign="top"><code>ADR1</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_ADR2</code><br>
-         </td>
-         <td valign="top"><code>ADR2</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_CITY</code><br>
-         </td>
-         <td valign="top"><code>CITY</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_STAE</code><br>
-         </td>
-         <td valign="top"><code>STAE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_POST</code><br>
-         </td>
-         <td valign="top"><code>POST</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ADDR_CTRY</code><br>
-         </td>
-         <td valign="top"><code>CTRY</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ADDR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PHON</code><br>
-         </td>
-         <td valign="top"><code>PHON</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_SOUR_CORP,<br>
-  REC_REPO, REC_SUBM,<br>
-        </code><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI,<br>
-  ELT_SUB_INDIV_BIRT,<br>
-  ELT_SUB_INDIV_GEN,<br>
-  ELT_SUB_INDIV_ADOP<br>
-        </code><br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ASSO</code><br>
-         </td>
-         <td valign="top"><code>ASSO</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ASSO_TYPE</code><br>
-         </td>
-         <td valign="top"><code>TYPE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ASSO</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_ASSO_RELA</code><br>
-         </td>
-         <td valign="top"><code>RELA</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_ASSO</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_CHAN</code><br>
-         </td>
-         <td valign="top"><code>CHAN</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_OBJE, REC_NOTE,<br>
-  REC_REPO, REC_SOUR,<br>
-  REC_SUBM<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_CHAN_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_CHAN</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_CHAN_TIME</code><br>
-         </td>
-         <td valign="top"><code>TIME</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_CHAN_DATE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAMC</code><br>
-         </td>
-         <td valign="top"><code>FAMC</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAMC_PEDI</code><br>
-         </td>
-         <td valign="top"><code>PEDI</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAMC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_CONT</code><br>
-         </td>
-         <td valign="top"><code>CONT</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_NOTE, REC_NOTE,<br>
-  ELT_SOUR_AUTH, ELT_SOUR_TITL,<br>
-  ELT_SOUR_PUBL, ELT_SOUR_TEXT,<br>
-  ELT_SUB_NOTE, <br>
-  ELT_SUB_SOUR, ELT_SUB_SOUR_TEXT<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_CONC</code><br>
-         </td>
-         <td valign="top"><code>CONC</code><br>
-         </td>
-         <td valign="top"><code>ELT_HEAD_NOTE, REC_NOTE,<br>
-  ELT_SOUR_AUTH, ELT_SOUR_TITL,<br>
-  ELT_SOUR_PUBL, ELT_SOUR_TEXT,<br>
-  ELT_SUB_NOTE, <br>
-  ELT_SUB_SOUR, ELT_SUB_SOUR_TEXT<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_EVT_TYPE</code><br>
-         </td>
-         <td valign="top"><code>TYPE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI,<br>
-  ELT_SUB_INDIV_BIRT,<br>
-  ELT_SUB_INDIV_GEN,<br>
-  ELT_SUB_INDIV_ADOP<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_EVT_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
-        <code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR</code><code>,<br>
-   ELT_SUB_INDIV_RESI,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP<br>
-        </code><br>
-        <br>
-        <br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_EVT_AGE</code><br>
-         </td>
-         <td valign="top"><code>AGE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP</code><br>
-        <br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_EVT_AGNC</code><br>
-         </td>
-         <td valign="top"><code>AGNC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP</code><br>
-        <br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_EVT_CAUS</code><br>
-         </td>
-         <td valign="top"><code>CAUS</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP</code><br>
-        <br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAM_EVT</code><br>
-         </td>
-         <td valign="top"><code>ANUL, CENS, DIV,<br>
-   DIVF, ENGA, MARR,<br>
-   MARB, MARC, MARL,<br>
-   MARS</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAM_EVT_HUSB</code><br>
-         </td>
-         <td valign="top"><code>HUSB</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
-        <code>ELT_SUB_FAM_EVT_EVEN</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAM_EVT_WIFE</code><br>
-         </td>
-         <td valign="top"><code>WIFE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
-        <code>ELT_SUB_FAM_EVT_EVEN</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAM_EVT_AGE</code><br>
-         </td>
-         <td valign="top"><code>AGE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT_HUSB</code>,<br>
-        <code>ELT_SUB_FAM_EVT_WIFE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAM_EVT_EVEN</code><br>
-         </td>
-         <td valign="top"><code>EVEN</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_IDENT_REFN</code><br>
-         </td>
-         <td valign="top"><code>REFN</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_OBJE, REC_NOTE,<br>
-  REC_REPO, REC_SOUR<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_IDENT_REFN_TYPE</code><br>
-         </td>
-         <td valign="top"><code>TYPE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_IDENT_REFN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_IDENT_RIN</code><br>
-         </td>
-         <td valign="top"><code>RIN</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_OBJE, REC_NOTE,<br>
-  REC_REPO, REC_SOUR<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_ATTR</code><br>
-         </td>
-         <td valign="top"><code>CAST, DSCR, EDUC,<br>
-   IDNO, NATI, NCHR,<br>
-   NMR, OCCU, PROP,<br>
-   RELI, SSN, TITL</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_RESI</code><br>
-         </td>
-         <td valign="top"><code>RESI</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_BIRT</code><br>
-         </td>
-         <td valign="top"><code>BIRT, CHR</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_BIRT_FAMC</code><br>
-         </td>
-         <td valign="top"><code>FAMC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_INDIV_BIRT</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_GEN</code><br>
-         </td>
-         <td valign="top"><code>DEAT, BURI, CREM,<br>
-   BAPM, BARM, BASM,<br>
-   BLES, CHRA, CONF,<br>
-   FCOM, ORDN, NATU,<br>
-   EMIG, IMMI, CENS,<br>
-   PROB, WILL, GRAD,<br>
-   RETI</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_ADOP</code><br>
-         </td>
-         <td valign="top"><code>ADOP</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC</code><br>
-         </td>
-         <td valign="top"><code>FAMC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_INDIV_ADOP</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC_ADOP</code><br>
-         </td>
-         <td valign="top"><code>ADOP</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_INDIV_ADOP_FAMC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_INDIV_EVEN</code><br>
-         </td>
-         <td valign="top"><code>EVEN</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL</code><br>
-         </td>
-         <td valign="top"><code>BAPL, CONL, ENDL</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL_STAT</code><br>
-         </td>
-         <td valign="top"><code>STAT</code><br>
-         </td>
-         <td valign="top"><code></code><code>ELT_SUB_LIO_BAPL,<br>
-  ELT_SUB_LIO_SLGC<br>
-        </code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
-   ELT_SUB_LIO_SLGC<br>
-        </code><br>
-        <br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL_TEMP</code><br>
-         </td>
-         <td valign="top"><code>TEMP</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
-   ELT_SUB_LIO_SLGC<br>
-        </code><br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL_PLAC</code><br>
-         </td>
-         <td valign="top"><code>PLAC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LIO_BAPL</code><code>,<br>
-   ELT_SUB_LIO_SLGC<br>
-        </code><br>
-        <br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_SLGC</code><br>
-         </td>
-         <td valign="top"><code>SLGC</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LIO_SLGC_FAMC</code><br>
-         </td>
-         <td valign="top"><code>FAMC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LIO_SLGC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
-         </td>
-         <td valign="top"><code>SLGS</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS_STAT</code><br>
-         </td>
-         <td valign="top"><code>STAT</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS_TEMP</code><br>
-         </td>
-         <td valign="top"><code>TEMP</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS_PLAC</code><br>
-         </td>
-         <td valign="top"><code>PLAC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_LSS_SLGS</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
-         </td>
-         <td valign="top"><code>OBJE</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_SOUR, REC_SUBM,<br>
-        </code><code>ELT_SUB_FAM_EVT,<br>
-  ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP,<br>
-  ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE_FORM</code><br>
-         </td>
-         <td valign="top"><code>FORM</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE_TITL</code><br>
-         </td>
-         <td valign="top"><code>TITL</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE_FILE</code><br>
-         </td>
-         <td valign="top"><code>FILE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_MULTIM_OBJE</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_NOTE</code><br>
-         </td>
-         <td valign="top"><code>NOTE</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_OBJE, REC_REPO,<br>
-  REC_SOUR, ELT_SOUR_DATA,<br>
-  ELT_SUB_ASSO, ELT_SUB_CHAN,<br>
-  ELT_SUB_FAMC, </code><code>ELT_SUB_FAM_EVT,<br>
-  ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP,<br>
-  ELT_SUB_LIO_BAPL,<br>
-  ELT_SUB_LIO_SLGC,<br>
-  ELT_SUB_LSS_SLGS,<br>
-  ELT_SUB_MULTIM_OBJE,<br>
-  ELT_SUB_PERS_NAME,<br>
-  ELT_SUB_PLAC,<br>
-  ELT_SUB_SOUR,<br>
-  ELT_SUB_REPO,<br>
-  ELT_SUB_FAMS</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>NAME</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_NPFX</code><br>
-         </td>
-         <td valign="top"><code>NPFX</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_GIVN</code><br>
-         </td>
-         <td valign="top"><code>GIVN</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_NICK</code><br>
-         </td>
-         <td valign="top"><code>NICK</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_SPFX</code><br>
-         </td>
-         <td valign="top"><code>SPFX</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_SURN</code><br>
-         </td>
-         <td valign="top"><code>SURN</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PERS_NAME_NSFX</code><br>
-         </td>
-         <td valign="top"><code>NSFX</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PERS_NAME</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PLAC</code><br>
-         </td>
-         <td valign="top"><code>PLAC</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_FAM_EVT</code>,<br>
-        <code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_PLAC_FORM</code><br>
-         </td>
-         <td valign="top"><code>FORM</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_PLAC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>SOUR</code><br>
-         </td>
-         <td valign="top"><code>REC_FAM, REC_INDI,<br>
-  REC_NOTE, ELT_SUB_ASSO<br>
-        </code><code>ELT_SUB_FAM_EVT,<br>
-        </code><code>ELT_SUB_FAM_EVT_EVEN,<br>
-  ELT_SUB_INDIV_ATTR,<br>
-  ELT_SUB_INDIV_RESI</code><code>,<br>
-   ELT_SUB_INDIV_BIRT,<br>
-   ELT_SUB_INDIV_GEN,<br>
-   ELT_SUB_INDIV_ADOP,<br>
-  ELT_SUB_LIO_BAPL,<br>
-  ELT_SUB_LIO_SLGC,<br>
-  ELT_SUB_LSS_SLGS,<br>
-  ELT_SUB_NOTE,<br>
-  ELT_SUB_PERS_NAME,<br>
-  ELT_SUB_PLAC</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_PAGE</code><br>
-         </td>
-         <td valign="top"><code>PAGE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_EVEN</code><br>
-         </td>
-         <td valign="top"><code>EVEN</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_EVEN_ROLE</code><br>
-         </td>
-         <td valign="top"><code>ROLE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR_EVEN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>DATA</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>NULL</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_DATA_DATE</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>DATE</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_TEXT</code><br>
-         </td>
-         <td valign="top"><code>TEXT</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR<br>
-  ELT_SUB_SOUR_DATA</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_SOUR_QUAY</code><br>
-         </td>
-         <td valign="top"><code>QUAY</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_REPO</code><br>
-         </td>
-         <td valign="top"><code>REPO</code><br>
-         </td>
-         <td valign="top"><code>REC_SOUR</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_REPO_CALN</code><br>
-         </td>
-         <td valign="top"><code>CALN</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_REPO</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_REPO_CALN_MEDI</code><br>
-         </td>
-         <td valign="top"><code>MEDI</code><br>
-         </td>
-         <td valign="top"><code>ELT_SUB_REPO_CALN</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_SUB_FAMS</code><br>
-         </td>
-         <td valign="top"><code>FAMS</code><br>
-         </td>
-         <td valign="top"><code>REC_INDI</code><br>
-         </td>
-         <td valign="top"><code>STRING</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top"><code>ELT_USER</code><br>
-         </td>
-         <td valign="top"><code>any tag starting<br>
-   with an underscore</code><br>
-         </td>
-         <td valign="top"><code>anywhere</code><br>
-         </td>
-         <td valign="top"><code>NULL<br>
-   STRING</code><br>
-         </td>
-       </tr>
-           
-  </tbody>   
-</table>
-       
-<hr width="100%" size="2">    
+         
+<hr width="100%" size="2">     
 <h2><a name="Gedcom_val_types"></a>Gedcom_val types<br>
-    </h2>
-    Currently, the specific <code>Gedcom_val</code> types are (with <code>
- val</code>   of type <code>Gedcom_val</code>):<br>
-   <br>
-     
+     </h2>
+     Currently, the specific <code>Gedcom_val</code> types are (with <code>
 val</code>   of type <code>Gedcom_val</code>):<br>
+    <br>
+       
 <table cellpadding="2" cellspacing="2" border="1" width="100%">
-     <tbody>
-       <tr>
-         <td valign="top"><br>
-         </td>
-         <td valign="top"><b>type checker</b><br>
-         </td>
-         <td valign="top"><b>cast operator</b><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top">null value<br>
-         </td>
-         <td valign="top"><code>GEDCOM_IS_NULL(val)</code><br>
-         </td>
-         <td valign="top">N/A<br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top">string<br>
-         </td>
-         <td valign="top"><code>GEDCOM_IS_STRING(val)</code><br>
-         </td>
-         <td valign="top"><code>char* str = GEDCOM_STRING(val);</code><br>
-         </td>
-       </tr>
-       <tr>
-         <td valign="top">date<br>
-         </td>
-         <td valign="top"><code>GEDCOM_IS_DATE(val)</code><br>
-         </td>
-         <td valign="top"><code>struct date_value dv = GEDCOM_DATE(val);</code></td>
-       </tr>
-           
-  </tbody>   
+      <tbody>
+        <tr>
+          <td valign="top"><br>
+          </td>
+          <td valign="top"><b>type checker</b><br>
+          </td>
+          <td valign="top"><b>cast operator</b><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top">null value<br>
+          </td>
+          <td valign="top"><code>GEDCOM_IS_NULL(val)</code><br>
+          </td>
+          <td valign="top">N/A<br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top">string<br>
+          </td>
+          <td valign="top"><code>GEDCOM_IS_STRING(val)</code><br>
+          </td>
+          <td valign="top"><code>char* str = GEDCOM_STRING(val);</code><br>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top">date<br>
+          </td>
+          <td valign="top"><code>GEDCOM_IS_DATE(val)</code><br>
+          </td>
+          <td valign="top"><code>struct date_value dv = GEDCOM_DATE(val);</code></td>
+        </tr>
+    <tr>
+      <td valign="top">xref pointer<br>
+      </td>
+      <td valign="top"><code>GEDCOM_IS_XREF_PTR(val)</code><br>
+      </td>
+      <td valign="top"><code>struct xref_value *xr = GEDCOM_XREF_PTR(val);</code><br>
+      </td>
+    </tr>
+               
+  </tbody>    
 </table>
-   <br>
-   <br>
-     The type checker returns a true or a false value according to the type 
- of the value, but this is in principle only necessary in the rare circumstances
-  that two types are possible, or where an optional value can be provided.
+    <br>
+    <br>
+      The type checker returns a true or a false value according to the type
+  of the value, but this is in principle only necessary in the rare circumstances 
+  that two types are possible, or where an optional value can be provided. 
  &nbsp;In most cases, the type is fixed for a specific tag.<br>
-   <br>
-    The null value is used for when the GEDCOM spec doesn't allow a value,
+    <br>
+     The null value is used for when the GEDCOM spec doesn't allow a value, 
  or  when an optional value is allowed but none is given.<br>
-    &nbsp; <br>
-    The string value is the most general used value currently, for all those
-  values that don't have a more specific meaning. &nbsp;In essence, the value
-  that is returned by GEDCOM_STRING is always the same as the raw_value passed
+     &nbsp; <br>
+     The string value is the most general used value currently, for all those 
+  values that don't have a more specific meaning. &nbsp;In essence, the value 
+  that is returned by GEDCOM_STRING is always the same as the raw_value passed 
   to the start callback, and is thus in fact redundant.<br>
-   <br>
-    The date value is used for all elements that return a date.<br>
-   <br>
-     
+    <br>
+     The date value is used for all elements that return a date. &nbsp;See
+<a href="#struct_date_value">here</a> for the definition.<br>
+<br>
+The xref value is for cross-references between records in the file. &nbsp;See
+<a href="#struct_xref_value">here</a> for the definition.<br>
+    <br>
+       
 <h3><a name="struct_date_value"></a>struct date_value</h3>
-   This struct describes a date as given in the GEDCOM file, and has the
+    This struct describes a date as given in the GEDCOM file, and has the 
 following  definition:<br>
-     
+       
 <blockquote><code>struct date_value {<br>
-   &nbsp; Date_value_type &nbsp;type;<br>
-   &nbsp; struct date &nbsp; &nbsp; &nbsp;date1;<br>
-   &nbsp; struct date &nbsp; &nbsp; &nbsp;date2;<br>
-   &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phrase[MAX_PHRASE_LEN 
- + 1];<br>
-   };</code><br>
-     </blockquote>
-     It depends on the first member, the type, which members are actually 
-relevant:<br>
-     <br>
-           
+    &nbsp; Date_value_type &nbsp;type;<br>
+    &nbsp; struct date &nbsp; &nbsp; &nbsp;date1;<br>
+    &nbsp; struct date &nbsp; &nbsp; &nbsp;date2;<br>
+    &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phrase[MAX_PHRASE_LEN
 + 1];<br>
+    };</code><br>
+      </blockquote>
+      It depends on the first member, the type, which members are actually
+ relevant:<br>
+      <br>
+               
   <table cellpadding="2" cellspacing="2" border="1" width="100%">
-       <tbody>
-         <tr>
-           <td valign="top" align="center"><b>Date_value_type</b><br>
-           </td>
-           <td valign="top" align="center"><b>Meaning</b><br>
-           </td>
-           <td valign="top" align="center"><b>Relevant members</b><br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_NO_MODIFIER</code><br>
-           </td>
-           <td valign="top">just a simple date<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_BEFORE</code><br>
-           </td>
-           <td valign="top">a range (BEFORE date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_AFTER</code><br>
-           </td>
-           <td valign="top">a range (AFTER date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_BETWEEN</code><br>
-           </td>
-           <td valign="top">a range (BETWEEN date1 AND date2)<br>
-           </td>
-           <td valign="top">date1, date2<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_FROM</code><br>
-           </td>
-           <td valign="top">a period (FROM date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_TO</code><br>
-           </td>
-           <td valign="top">a period (TO date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_FROM_TO</code><br>
-           </td>
-           <td valign="top">a period (FROM date1 TO date2)<br>
-           </td>
-           <td valign="top">date1, date2<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_ABOUT</code><br>
-           </td>
-           <td valign="top">an approximation (ABOUT date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_CALCULATED</code><br>
-           </td>
-           <td valign="top">an approximation (CALCULATED date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_ESTIMATED</code><br>
-           </td>
-           <td valign="top">an approximation (ESTIMATED date1)<br>
-           </td>
-           <td valign="top">date1<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_INTERPRETED</code><br>
-           </td>
-           <td valign="top">INTERPRETED date1 FROM a given free form date 
-phrase<br>
-           </td>
-           <td valign="top">date1, phrase<br>
-           </td>
-         </tr>
-         <tr>
-           <td valign="top"><code>DV_PHRASE</code><br>
-           </td>
-           <td valign="top">a free form date phrase<br>
-           </td>
-           <td valign="top">phrase<br>
-           </td>
-         </tr>
-                 
-    </tbody>         
+        <tbody>
+          <tr>
+            <td valign="top" align="center"><b>Date_value_type</b><br>
+            </td>
+            <td valign="top" align="center"><b>Meaning</b><br>
+            </td>
+            <td valign="top" align="center"><b>Relevant members</b><br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_NO_MODIFIER</code><br>
+            </td>
+            <td valign="top">just a simple date<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_BEFORE</code><br>
+            </td>
+            <td valign="top">a range (BEFORE date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_AFTER</code><br>
+            </td>
+            <td valign="top">a range (AFTER date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_BETWEEN</code><br>
+            </td>
+            <td valign="top">a range (BETWEEN date1 AND date2)<br>
+            </td>
+            <td valign="top">date1, date2<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_FROM</code><br>
+            </td>
+            <td valign="top">a period (FROM date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_TO</code><br>
+            </td>
+            <td valign="top">a period (TO date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_FROM_TO</code><br>
+            </td>
+            <td valign="top">a period (FROM date1 TO date2)<br>
+            </td>
+            <td valign="top">date1, date2<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_ABOUT</code><br>
+            </td>
+            <td valign="top">an approximation (ABOUT date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_CALCULATED</code><br>
+            </td>
+            <td valign="top">an approximation (CALCULATED date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_ESTIMATED</code><br>
+            </td>
+            <td valign="top">an approximation (ESTIMATED date1)<br>
+            </td>
+            <td valign="top">date1<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_INTERPRETED</code><br>
+            </td>
+            <td valign="top">INTERPRETED date1 FROM a given free form date
+ phrase<br>
+            </td>
+            <td valign="top">date1, phrase<br>
+            </td>
+          </tr>
+          <tr>
+            <td valign="top"><code>DV_PHRASE</code><br>
+            </td>
+            <td valign="top">a free form date phrase<br>
+            </td>
+            <td valign="top">phrase<br>
+            </td>
+          </tr>
+                       
+    </tbody>            
   </table>
-     <br>
-           
+      <br>
+               
   <h3><a name="struct_date"></a>struct date<br>
-     </h3>
-   The <code>date1</code> and <code>date2</code> also have a strict syntax:<br>
-           
+      </h3>
+    The <code>date1</code> and <code>date2</code> also have a strict syntax:<br>
+               
   <blockquote><code>struct date {<br>
-   &nbsp; Calendar_type &nbsp;cal;<br>
-   &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; day_str[MAX_DAY_LEN + 1];<br>
-   &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; month_str[MAX_MONTH_LEN 
-+  1];<br>
-   &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; year_str[MAX_YEAR_LEN + 
+    &nbsp; Calendar_type &nbsp;cal;<br>
+    &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; day_str[MAX_DAY_LEN +
 1];<br>
-       <br>
-   &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;day;<br>
-   &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;month;<br>
-   &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;year;<br>
-   &nbsp; Year_type &nbsp; &nbsp; &nbsp;year_type;<br>
-       <br>
-   &nbsp; Date_type &nbsp; &nbsp; &nbsp;type;<br>
-   &nbsp; long int &nbsp; &nbsp; &nbsp; sdn1;<br>
-   &nbsp; long int &nbsp; &nbsp; &nbsp; sdn2;<br>
-   };</code><br>
-       </blockquote>
-   The first four fields are the primary fields parsed from the value in
-the  GEDCOM file. &nbsp;The <code>day_str</code>, <code>month_str</code>
-and     <code>  year_str</code> are the literal parts of the date that denote 
-the day, month  and year (the <code>day_str</code> and <code>month_str</code>
-  can be empty) . &nbsp;The calendar type <code>cal</code> is one of (see 
-calendar overview     <i>LINK TBD</i>):<br>
-                 
+    &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; month_str[MAX_MONTH_LEN
+ +  1];<br>
+    &nbsp; char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; year_str[MAX_YEAR_LEN
++  1];<br>
+        <br>
+    &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;day;<br>
+    &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;month;<br>
+    &nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;year;<br>
+    &nbsp; Year_type &nbsp; &nbsp; &nbsp;year_type;<br>
+        <br>
+    &nbsp; Date_type &nbsp; &nbsp; &nbsp;type;<br>
+    &nbsp; long int &nbsp; &nbsp; &nbsp; sdn1;<br>
+    &nbsp; long int &nbsp; &nbsp; &nbsp; sdn2;<br>
+    };</code><br>
+        </blockquote>
+    The first four fields are the primary fields parsed from the value in 
+the  GEDCOM file. &nbsp;The <code>day_str</code>, <code>month_str</code> and
+    <code>  year_str</code> are the literal parts of the date that denote
+ the day, month  and year (the <code>day_str</code> and <code>month_str</code>
+   can be empty) . &nbsp;The calendar type <code>cal</code> is one of (see
+ calendar overview     <i>LINK TBD</i>):<br>
+                       
     <ul>
-         <li><code>CAL_GREGORIAN</code> : the Gregorian calendar</li>
-         <li><code>CAL_JULIAN</code> : the Julian calendar</li>
-         <li><code>CAL_HEBREW</code> : the Hebrew (Jewish) calendar</li>
-         <li><code>CAL_FRENCH_REV</code> : the calendar used after the French 
- Revolution</li>
-         <li><code>CAL_UNKNOWN</code> : an unknown calendar type</li>
-                 
+          <li><code>CAL_GREGORIAN</code> : the Gregorian calendar</li>
+          <li><code>CAL_JULIAN</code> : the Julian calendar</li>
+          <li><code>CAL_HEBREW</code> : the Hebrew (Jewish) calendar</li>
+          <li><code>CAL_FRENCH_REV</code> : the calendar used after the French
 Revolution</li>
+          <li><code>CAL_UNKNOWN</code> : an unknown calendar type</li>
+                       
     </ul>
-   The next four fields are deduced from the first four:<br>
-                 
+    The next four fields are deduced from the first four:<br>
+                       
     <ul>
-         <li>the <code>day</code> is just the numeric representation of the 
-         <code>day_str</code> (starting from 1), -1 if the <code>day_str</code>
-   is empty</li>
-         <li>the <code>month</code> is the month number of <code>month_str</code>
-    in the given calendar type (also starting from 1), -1 if the <code>month_str</code>
-   is empty</li>
-         <li>the <code>year</code> is the numeric representation of the <code>
-   year_str</code></li>
-                 
+          <li>the <code>day</code> is just the numeric representation of
+the           <code>day_str</code> (starting from 1), -1 if the <code>day_str</code>
+    is empty</li>
+          <li>the <code>month</code> is the month number of <code>month_str</code>
+     in the given calendar type (also starting from 1), -1 if the <code>month_str</code>
+    is empty</li>
+          <li>the <code>year</code> is the numeric representation of the
+        <code>    year_str</code></li>
+                       
     </ul>
-   It is possible that the <code>year_str</code> is given as e.g. "1677/78". 
- &nbsp;This is coming from a date in a so called "annunciation style", where 
- the year began on 25 March: "20 March 1677/78" is 20 March 1677 in "annunciation
- style" and 20 March 1678 in "circumcision style" (the current style). &nbsp;See
+    It is possible that the <code>year_str</code> is given as e.g. "1677/78".
+  &nbsp;This is coming from a date in a so called "annunciation style", where
+  the year began on 25 March: "20 March 1677/78" is 20 March 1677 in "annunciation 
+ style" and 20 March 1678 in "circumcision style" (the current style). &nbsp;See 
  calendar overview (<i>LINK TBD</i>).<br>
-       <br>
-   In this case, the <code>year</code> will contain the "circumcision style" 
- year (1678 in the example), and <code>year_type</code> will be <code>YEAR_DOUBLE.</code>
-    &nbsp;Normal dates will have a <code>year_type</code> equal to <code>
-YEAR_SINGLE</code>   .<br>
-       <br>
-   Finally, the last three fields are probably the most interesting values
- for applications that want to process dates. &nbsp;Basically, the date is
- converted to a serial day number (aka Julian day), which is the unique day
- number since November 25, 4714 BC in the Gregorian calendar. &nbsp;The advantage
- of these day numbers is that they are unique and independent of the calendar
- system. &nbsp;Furthermore, date differences can just be computed by subtracting
+        <br>
+    In this case, the <code>year</code> will contain the "circumcision style"
 year (1678 in the example), and <code>year_type</code> will be <code>YEAR_DOUBLE.</code>
+     &nbsp;Normal dates will have a <code>year_type</code> equal to <code>
+ YEAR_SINGLE</code>   .<br>
+        <br>
+    Finally, the last three fields are probably the most interesting values 
+ for applications that want to process dates. &nbsp;Basically, the date is 
+ converted to a serial day number (aka Julian day), which is the unique day 
+ number since November 25, 4714 BC in the Gregorian calendar. &nbsp;The advantage 
+ of these day numbers is that they are unique and independent of the calendar 
+ system. &nbsp;Furthermore, date differences can just be computed by subtracting 
  the serial day numbers.<br>
-       <br>
-   However, since dates in GEDCOM are not necessarily exact (e.g. "MAR 1990"), 
- it is not possible to represent all GEDCOM dates with 1 serial day number. 
- &nbsp;Two cases can be distinguished:<br>
-                 
+        <br>
+    However, since dates in GEDCOM are not necessarily exact (e.g. "MAR 1990"),
+  it is not possible to represent all GEDCOM dates with 1 serial day number.
 &nbsp;Two cases can be distinguished:<br>
+                       
     <ul>
-         <li>Exact dates (e.g. "25 MAR 1990"):</li>
-                 
+          <li>Exact dates (e.g. "25 MAR 1990"):</li>
+                       
     </ul>
-                 
-    <blockquote>                     
+                       
+    <blockquote>                            
       <blockquote>These are represented by a serial day number in <code>sdn1</code>
-    and a <code>Date_type</code> equal to <code>DATE_EXACT</code>.<br>
-           </blockquote>
-           </blockquote>
-                             
+     and a <code>Date_type</code> equal to <code>DATE_EXACT</code>.<br>
+            </blockquote>
+            </blockquote>
+                                       
         <ul>
-             <li>Incomplete dates (e.g. "MAR 1990"):</li>
-                             
+              <li>Incomplete dates (e.g. "MAR 1990"):</li>
+                                       
         </ul>
-                             
-        <blockquote>                                 
+                                       
+        <blockquote>                                            
           <blockquote>These are represented by 2 serial day numbers (<code>
-  sdn1</code> and <code>sdn2</code>) and a <code>Date_type</code> equal to
-             <code>DATE_BOUNDED</code>.<br>
-               <br>
-   For example, the Gregorian date "MAR 1990" is represented by the serial
- day numbers for "1 MAR 1990" and "31 MAR 1990", and the Gregorian date "1990" 
- is represented by the serial day numbers for "1 JAN 1990" and "31 DEC 1990". 
- &nbsp;Similarly for the other calendar types.<br>
-               </blockquote>
-               </blockquote>
-               <br>
-                                         
-            <hr width="100%" size="2">
-            <pre>$Id$<br>$Name$<br></pre>
-    <br>
-                                           
-            </body>
-            </html>
+   sdn1</code> and <code>sdn2</code>) and a <code>Date_type</code> equal
+to              <code>DATE_BOUNDED</code>.<br>
+                <br>
+    For example, the Gregorian date "MAR 1990" is represented by the serial 
+ day numbers for "1 MAR 1990" and "31 MAR 1990", and the Gregorian date "1990"
+  is represented by the serial day numbers for "1 JAN 1990" and "31 DEC 1990".
+  &nbsp;Similarly for the other calendar types.<br>
+                </blockquote>
+                </blockquote>
+                
+            <h3><a name="struct_xref_value"></a>struct xref_value</h3>
+This struct represents a cross-reference in the GEDCOM file (but note that
+the <code>Gedcom_val</code> contains a pointer to such a struct, not the
+struct itself). &nbsp;It is defined as:<br>
+            <blockquote><code>struct xref_value {<br>
+&nbsp; Xref_type &nbsp; type,<br>
+&nbsp; char* &nbsp; &nbsp; &nbsp; string,<br>
+&nbsp; Gedcom_ctxt object<br>
+};</code><br>
+              </blockquote>
+The <code>Xref_type</code> gives the type of the cross-reference and can
+be one of:<br>
+              <ul>
+                <li><code>XREF_NONE</code> (used as default value)</li>
+                <li><code>XREF_FAM</code></li>
+                <li><code>XREF_INDI</code></li>
+                <li><code>XREF_NOTE</code></li>
+                <li><code>XREF_OBJE</code></li>
+                <li><code>XREF_REPO</code></li>
+                <li><code>XREF_SOUR</code></li>
+                <li><code>XREF_SUBM</code></li>
+                <li><code>XREF_SUBN</code></li>
+                <li><code>XREF_USER</code> (for application-specific cross-references)<br>
+                  <code></code></li>
+              </ul>
+The <code>string</code> gives the actual cross-reference string from the
+GEDCOM file, and the <code>object</code> is initially <code>NULL,</code>
+but can be filled by the application with an object (of any type) that corresponds
+with the cross-reference, and then later extracted when the cross-reference
+is used or defined again in the file. &nbsp;This relieves the application
+from the burden of maintaining the mapping between cross-references and objects.<br>
+              <br>
+The parser checks whether all cross-references that are used are defined
+(if not, an error is produced) and whether all cross-references that are
+defined are used (if not, a warning is produced). &nbsp;It also checks whether
+the type of the cross-reference is the same on definition and use (if not,
+an error is produced).<br>
+              <br>
+                                                       
+              <hr width="100%" size="2">             
+              <pre>$Id$<br>$Name$<br></pre>
+     <br>
+                                                         
+              </body>
+              </html>
index 0fd201e7aad2b9b9495b42c2e606df580a751645..1081476109d041a82be4df61a267933c66f1727d 100644 (file)
@@ -23,7 +23,8 @@ libgedcom_la_SOURCES = lex.gedcom_1byte_.c \
                        encoding.c \
                        interface.c \
                       date.c \
-                      hash.c
+                      hash.c \
+                      xref.c
 libgedcom_la_LDFLAGS = -version-info $(LIBVERSION)
 libgedcom_la_LIBADD  = calendar/libcalendar.la
 BUILT_SOURCES = lex.gedcom_1byte_.c \
@@ -39,7 +40,8 @@ noinst_HEADERS = encoding.h \
                 interface.h \
                 multilex.h \
                 date.h \
-                hash.h
+                hash.h \
+                xref.h
 EXTRA_DIST = gedcom.y \
             gedcom_date.y \
             gedcom_1byte.lex \
index a0481851dd4aa3e0e1ba5a2737c6f88d402744f3..3302c1b808fa718eab3af3e93aeae6f7992ce75b 100644 (file)
 #include "encoding.h"
 #include "interface.h"
 #include "date.h"
+#include "xref.h"
 
 int  count_level    = 0;
 int  fail           = 0;
@@ -153,7 +154,8 @@ int  compat_enabled = 1;
 int  gedcom_high_level_debug = 0; 
 int  compatibility  = 0; 
 Gedcom_err_mech error_mechanism = IMMED_FAIL;
-Gedcom_val_struct val; 
+Gedcom_val_struct val1;
+Gedcom_val_struct val2; 
  
 char line_item_buf[MAXGEDCLINELEN * UTF_FACTOR + 1];
 char *line_item_buf_ptr;
@@ -402,7 +404,6 @@ int  compat_mode(int flags);
 %type <tag> indiv_gen_tag
 %type <tag> lio_bapl_tag
 %type <string> line_item
-%type <string> line_value
 %type <string> mand_line_item
 %type <string> mand_pointer
 %type <string> note_line_item
@@ -437,8 +438,9 @@ record      : fam_rec
 /**** Header                                                      ****/
 /*********************************************************************/
 head_sect    : OPEN DELIM TAG_HEAD
-               { $<ctxt>$ = start_record(REC_HEAD, $1, GEDCOM_MAKE_NULL(), $3,
-                                        NULL, GEDCOM_MAKE_NULL());
+               { $<ctxt>$ = start_record(REC_HEAD, $1, GEDCOM_MAKE_NULL(val1),
+                                        $3,
+                                        NULL, GEDCOM_MAKE_NULL(val2));
                 START(HEAD, $<ctxt>$) }
                head_subs
                { if (compat_mode(C_FTREE))
@@ -474,7 +476,7 @@ head_sour_sect : OPEN DELIM TAG_SOUR mand_line_item
                  { set_compatibility($4);
                   $<ctxt>$ = start_element(ELT_HEAD_SOUR, PARENT,
                                            $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(SOUR, $<ctxt>$)
                 }
                  head_sour_subs
@@ -497,7 +499,7 @@ head_sour_sub : head_sour_vers_sect  { OCCUR2(VERS, 0, 1) }
 head_sour_vers_sect : OPEN DELIM TAG_VERS mand_line_item
                       { $<ctxt>$ = start_element(ELT_HEAD_SOUR_VERS, PARENT,
                                                 $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(VERS, $<ctxt>$)
                      }
                       no_std_subs
@@ -510,7 +512,7 @@ head_sour_vers_sect : OPEN DELIM TAG_VERS mand_line_item
 head_sour_name_sect : OPEN DELIM TAG_NAME mand_line_item
                       { $<ctxt>$ = start_element(ELT_HEAD_SOUR_NAME, PARENT,
                                                 $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(NAME, $<ctxt>$)
                      }
                       no_std_subs
@@ -523,7 +525,7 @@ head_sour_name_sect : OPEN DELIM TAG_NAME mand_line_item
 head_sour_corp_sect : OPEN DELIM TAG_CORP mand_line_item 
                       { $<ctxt>$ = start_element(ELT_HEAD_SOUR_CORP, PARENT,
                                                 $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(CORP, $<ctxt>$)
                      }
                       head_sour_corp_subs
@@ -545,7 +547,7 @@ head_sour_corp_sub : addr_struc_sub  /* 0:1 */
 head_sour_data_sect : OPEN DELIM TAG_DATA mand_line_item 
                       { $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA, PARENT,
                                                 $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(DATA, $<ctxt>$)
                      }
                       head_sour_data_subs
@@ -567,9 +569,10 @@ head_sour_data_sub : head_sour_data_date_sect  { OCCUR2(DATE, 0, 1) }
 
 head_sour_data_date_sect : OPEN DELIM TAG_DATE mand_line_item
                            { struct date_value dv = gedcom_parse_date($4);
-                            $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA_DATE,
-                                                     PARENT, $1, $3, $4,
-                                                     GEDCOM_MAKE_DATE(dv));
+                            $<ctxt>$
+                              = start_element(ELT_HEAD_SOUR_DATA_DATE,
+                                              PARENT, $1, $3, $4,
+                                              GEDCOM_MAKE_DATE(val1, dv));
                             START(DATE, $<ctxt>$)
                           }
                            no_std_subs
@@ -580,9 +583,10 @@ head_sour_data_date_sect : OPEN DELIM TAG_DATE mand_line_item
                           }
                          ;
 head_sour_data_copr_sect : OPEN DELIM TAG_COPR mand_line_item
-                           { $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA_COPR,
-                                                     PARENT, $1, $3, $4,
-                                                     GEDCOM_MAKE_STRING($4));
+                           { $<ctxt>$
+                              = start_element(ELT_HEAD_SOUR_DATA_COPR,
+                                              PARENT, $1, $3, $4,
+                                              GEDCOM_MAKE_STRING(val1, $4));
                             START(COPR, $<ctxt>$)
                           }
                            no_std_subs
@@ -597,7 +601,7 @@ head_sour_data_copr_sect : OPEN DELIM TAG_COPR mand_line_item
 head_dest_sect : OPEN DELIM TAG_DEST mand_line_item
                  { $<ctxt>$ = start_element(ELT_HEAD_DEST,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(DEST, $<ctxt>$)
                 }
                  no_std_subs
@@ -613,7 +617,7 @@ head_date_sect : OPEN DELIM TAG_DATE mand_line_item
                  { struct date_value dv = gedcom_parse_date($4);
                   $<ctxt>$ = start_element(ELT_HEAD_DATE,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_DATE(dv));
+                                           GEDCOM_MAKE_DATE(val1, dv));
                   START(DATE, $<ctxt>$)
                 }
                  head_date_subs
@@ -635,7 +639,7 @@ head_date_sub  : head_date_time_sect  { OCCUR2(TIME, 0, 1) }
 head_date_time_sect : OPEN DELIM TAG_TIME mand_line_item
                       { $<ctxt>$ = start_element(ELT_HEAD_DATE_TIME,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(TIME, $<ctxt>$)
                      }
                       no_std_subs
@@ -648,9 +652,12 @@ head_date_time_sect : OPEN DELIM TAG_TIME mand_line_item
 
 /* HEAD.SUBM */
 head_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
-                 { $<ctxt>$ = start_element(ELT_HEAD_SUBM,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBM);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_HEAD_SUBM,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(SUBM, $<ctxt>$)
                 }
                  no_std_subs
@@ -662,9 +669,12 @@ head_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
                ;
 /* HEAD.SUBN */
 head_subn_sect : OPEN DELIM TAG_SUBN mand_pointer 
-                 { $<ctxt>$ = start_element(ELT_HEAD_SUBN,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBN);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_HEAD_SUBN,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(SUBN, $<ctxt>$)
                 }
                  no_std_subs
@@ -678,7 +688,7 @@ head_subn_sect : OPEN DELIM TAG_SUBN mand_pointer
 head_file_sect : OPEN DELIM TAG_FILE mand_line_item 
                  { $<ctxt>$ = start_element(ELT_HEAD_FILE,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(FILE, $<ctxt>$)
                 }
                  no_std_subs
@@ -691,7 +701,7 @@ head_file_sect : OPEN DELIM TAG_FILE mand_line_item
 head_copr_sect : OPEN DELIM TAG_COPR mand_line_item 
                  { $<ctxt>$ = start_element(ELT_HEAD_COPR,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(COPR, $<ctxt>$)
                 }
                  no_std_subs
@@ -704,7 +714,7 @@ head_copr_sect : OPEN DELIM TAG_COPR mand_line_item
 head_gedc_sect : OPEN DELIM TAG_GEDC
                  { $<ctxt>$ = start_element(ELT_HEAD_GEDC,
                                            PARENT, $1, $3, NULL,
-                                           GEDCOM_MAKE_NULL());
+                                           GEDCOM_MAKE_NULL(val1));
                   START(GEDC, $<ctxt>$)
                 }
                  head_gedc_subs
@@ -725,7 +735,7 @@ head_gedc_sub  : head_gedc_vers_sect  { OCCUR2(VERS, 1, 1) }
 head_gedc_vers_sect : OPEN DELIM TAG_VERS mand_line_item  
                       { $<ctxt>$ = start_element(ELT_HEAD_GEDC_VERS,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(VERS, $<ctxt>$)
                      }
                       no_std_subs
@@ -738,7 +748,7 @@ head_gedc_vers_sect : OPEN DELIM TAG_VERS mand_line_item
 head_gedc_form_sect : OPEN DELIM TAG_FORM mand_line_item   
                       { $<ctxt>$ = start_element(ELT_HEAD_GEDC_FORM,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(FORM, $<ctxt>$)
                      }
                       no_std_subs
@@ -754,7 +764,7 @@ head_char_sect : OPEN DELIM TAG_CHAR mand_line_item
                  { if (open_conv_to_internal($4) == 0) YYERROR;
                   $<ctxt>$ = start_element(ELT_HEAD_CHAR,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(CHAR, $<ctxt>$)
                 }
                  head_char_subs
@@ -774,7 +784,7 @@ head_char_sub  : head_char_vers_sect  { OCCUR2(VERS, 0, 1) }
 head_char_vers_sect : OPEN DELIM TAG_VERS mand_line_item   
                       { $<ctxt>$ = start_element(ELT_HEAD_CHAR_VERS,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(VERS, $<ctxt>$)
                      }
                       no_std_subs
@@ -789,7 +799,7 @@ head_char_vers_sect : OPEN DELIM TAG_VERS mand_line_item
 head_lang_sect : OPEN DELIM TAG_LANG mand_line_item   
                  { $<ctxt>$ = start_element(ELT_HEAD_LANG,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(LANG, $<ctxt>$)
                 }
                  no_std_subs
@@ -802,7 +812,7 @@ head_lang_sect : OPEN DELIM TAG_LANG mand_line_item
 head_plac_sect : OPEN DELIM TAG_PLAC
                  { $<ctxt>$ = start_element(ELT_HEAD_PLAC,
                                            PARENT, $1, $3, NULL,
-                                           GEDCOM_MAKE_NULL());
+                                           GEDCOM_MAKE_NULL(val1));
                   START(PLAC, $<ctxt>$)
                 }
                  head_plac_subs
@@ -822,7 +832,7 @@ head_plac_sub  : head_plac_form_sect  { OCCUR2(FORM, 1, 1) }
 head_plac_form_sect : OPEN DELIM TAG_FORM mand_line_item   
                       { $<ctxt>$ = start_element(ELT_HEAD_PLAC_FORM,
                                                 PARENT, $1, $3, $4, 
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(FORM, $<ctxt>$)
                      }
                       no_std_subs
@@ -837,7 +847,7 @@ head_plac_form_sect : OPEN DELIM TAG_FORM mand_line_item
 head_note_sect : OPEN DELIM TAG_NOTE mand_line_item 
                  { $<ctxt>$ = start_element(ELT_HEAD_NOTE,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(NOTE, $<ctxt>$)
                 }
                  head_note_subs
@@ -866,9 +876,13 @@ trlr_sect   : OPEN DELIM TAG_TRLR CLOSE { }
 /**** Family record                                               ****/
 /*********************************************************************/
 fam_rec      : OPEN DELIM POINTER DELIM TAG_FAM
-               { $<ctxt>$ = start_record(REC_FAM,
-                                        $1, GEDCOM_MAKE_STRING($3), $5,
-                                        NULL, GEDCOM_MAKE_NULL());
+               { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                          XREF_FAM);
+                if (xr == NULL) HANDLE_ERROR;
+                $<ctxt>$ = start_record(REC_FAM,
+                                        $1, GEDCOM_MAKE_XREF_PTR(val1, xr),
+                                        $5,
+                                        NULL, GEDCOM_MAKE_NULL(val2));
                 START(FAM, $<ctxt>$) }
                fam_subs
               { CHECK0 }
@@ -897,9 +911,12 @@ fam_sub      : fam_event_struc_sub  /* 0:M */
 
 /* FAM.HUSB */
 fam_husb_sect : OPEN DELIM TAG_HUSB mand_pointer    
-                { $<ctxt>$ = start_element(ELT_FAM_HUSB,
+                { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                           XREF_INDI);
+                 if (xr == NULL) HANDLE_ERROR;
+                 $<ctxt>$ = start_element(ELT_FAM_HUSB,
                                           PARENT, $1, $3, $4, 
-                                          GEDCOM_MAKE_STRING($4));
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                  START(HUSB, $<ctxt>$)
                }
                 no_std_subs
@@ -911,9 +928,12 @@ fam_husb_sect : OPEN DELIM TAG_HUSB mand_pointer
 
 /* FAM.WIFE */
 fam_wife_sect : OPEN DELIM TAG_WIFE mand_pointer 
-                { $<ctxt>$ = start_element(ELT_FAM_WIFE,
+                { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                           XREF_INDI);
+                 if (xr == NULL) HANDLE_ERROR;
+                 $<ctxt>$ = start_element(ELT_FAM_WIFE,
                                           PARENT, $1, $3, $4, 
-                                          GEDCOM_MAKE_STRING($4));
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                  START(WIFE, $<ctxt>$)
                }
                 no_std_subs
@@ -925,9 +945,12 @@ fam_wife_sect : OPEN DELIM TAG_WIFE mand_pointer
 
 /* FAM.CHIL */
 fam_chil_sect : OPEN DELIM TAG_CHIL mand_pointer
-                { $<ctxt>$ = start_element(ELT_FAM_CHIL,
+                { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                           XREF_INDI);
+                 if (xr == NULL) HANDLE_ERROR;
+                 $<ctxt>$ = start_element(ELT_FAM_CHIL,
                                           PARENT, $1, $3, $4, 
-                                          GEDCOM_MAKE_STRING($4));
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                  START(CHIL, $<ctxt>$) 
                } 
                no_std_subs 
@@ -941,7 +964,7 @@ fam_chil_sect : OPEN DELIM TAG_CHIL mand_pointer
 fam_nchi_sect : OPEN DELIM TAG_NCHI mand_line_item    
                 { $<ctxt>$ = start_element(ELT_FAM_NCHI,
                                           PARENT, $1, $3, $4, 
-                                          GEDCOM_MAKE_STRING($4));
+                                          GEDCOM_MAKE_STRING(val1, $4));
                  START(NCHI, $<ctxt>$)  
                }  
                no_std_subs  
@@ -953,9 +976,12 @@ fam_nchi_sect : OPEN DELIM TAG_NCHI mand_line_item
 
 /* FAM.SUBM */
 fam_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
-                { $<ctxt>$ = start_element(ELT_FAM_SUBM,
+                { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                           XREF_SUBM);
+                 if (xr == NULL) HANDLE_ERROR;
+                 $<ctxt>$ = start_element(ELT_FAM_SUBM,
                                           PARENT, $1, $3, $4, 
-                                          GEDCOM_MAKE_STRING($4));
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                  START(SUBM, $<ctxt>$)   
                }   
                no_std_subs   
@@ -969,9 +995,12 @@ fam_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
 /**** Individual record                                           ****/
 /*********************************************************************/
 indiv_rec   : OPEN DELIM POINTER DELIM TAG_INDI
-              { $<ctxt>$ = start_record(REC_INDI,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       NULL, GEDCOM_MAKE_NULL());
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_INDI);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_INDI,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       NULL, GEDCOM_MAKE_NULL(val2));
                START(INDI, $<ctxt>$) }
               indi_subs
              { CHECK0 }
@@ -1013,7 +1042,7 @@ indi_sub    : indi_resn_sect  { OCCUR2(RESN, 0, 1) }
 indi_resn_sect : OPEN DELIM TAG_RESN mand_line_item     
                  { $<ctxt>$ = start_element(ELT_INDI_RESN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RESN, $<ctxt>$)    
                 }    
                 no_std_subs     
@@ -1027,7 +1056,7 @@ indi_resn_sect : OPEN DELIM TAG_RESN mand_line_item
 indi_sex_sect  : OPEN DELIM TAG_SEX mand_line_item     
                  { $<ctxt>$ = start_element(ELT_INDI_SEX,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(SEX, $<ctxt>$)     
                 }     
                 no_std_subs     
@@ -1039,9 +1068,12 @@ indi_sex_sect  : OPEN DELIM TAG_SEX mand_line_item
 
 /* INDI.SUBM */
 indi_subm_sect : OPEN DELIM TAG_SUBM mand_pointer 
-                 { $<ctxt>$ = start_element(ELT_INDI_SUBM,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBM);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_INDI_SUBM,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(SUBM, $<ctxt>$)      
                 }      
                 no_std_subs      
@@ -1053,9 +1085,12 @@ indi_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
 
 /* INDI.ALIA */
 indi_alia_sect : OPEN DELIM TAG_ALIA mand_pointer
-                 { $<ctxt>$ = start_element(ELT_INDI_ALIA,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_INDI);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_INDI_ALIA,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(ALIA, $<ctxt>$)       
                 }       
                 no_std_subs       
@@ -1067,9 +1102,12 @@ indi_alia_sect : OPEN DELIM TAG_ALIA mand_pointer
 
 /* INDI.ANCI */
 indi_anci_sect : OPEN DELIM TAG_ANCI mand_pointer
-                 { $<ctxt>$ = start_element(ELT_INDI_ANCI,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBM);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_INDI_ANCI,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(ANCI, $<ctxt>$)        
                 }        
                 no_std_subs        
@@ -1081,9 +1119,12 @@ indi_anci_sect : OPEN DELIM TAG_ANCI mand_pointer
 
 /* INDI.DESI */
 indi_desi_sect : OPEN DELIM TAG_DESI mand_pointer
-                 { $<ctxt>$ = start_element(ELT_INDI_DESI,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBM);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_INDI_DESI,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(DESI, $<ctxt>$)         
                 }         
                 no_std_subs         
@@ -1097,7 +1138,7 @@ indi_desi_sect : OPEN DELIM TAG_DESI mand_pointer
 indi_rfn_sect  : OPEN DELIM TAG_RFN mand_line_item     
                  { $<ctxt>$ = start_element(ELT_INDI_RFN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RFN, $<ctxt>$)          
                 }          
                 no_std_subs          
@@ -1111,7 +1152,7 @@ indi_rfn_sect  : OPEN DELIM TAG_RFN mand_line_item
 indi_afn_sect  : OPEN DELIM TAG_AFN mand_line_item      
                  { $<ctxt>$ = start_element(ELT_INDI_AFN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(AFN, $<ctxt>$)           
                 }           
                 no_std_subs           
@@ -1129,9 +1170,12 @@ ftree_addr_sect : OPEN DELIM TAG_ADDR opt_line_item
 /**** Multimedia record                                           ****/
 /*********************************************************************/
 multim_rec  : OPEN DELIM POINTER DELIM TAG_OBJE
-              { $<ctxt>$ = start_record(REC_OBJE,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       NULL, GEDCOM_MAKE_NULL());
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_OBJE);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_OBJE,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       NULL, GEDCOM_MAKE_NULL(val2));
                START(OBJE, $<ctxt>$) }
               obje_subs
              { CHECK2(FORM, BLOB) }
@@ -1157,7 +1201,7 @@ obje_sub    : obje_form_sect  { OCCUR2(FORM, 1, 1) }
 obje_form_sect : OPEN DELIM TAG_FORM mand_line_item       
                  { $<ctxt>$ = start_element(ELT_OBJE_FORM,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(FORM, $<ctxt>$)            
                 }            
                 no_std_subs            
@@ -1171,7 +1215,7 @@ obje_form_sect : OPEN DELIM TAG_FORM mand_line_item
 obje_titl_sect : OPEN DELIM TAG_TITL mand_line_item       
                  { $<ctxt>$ = start_element(ELT_OBJE_TITL,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(TITL, $<ctxt>$)             
                 }             
                 no_std_subs             
@@ -1185,7 +1229,7 @@ obje_titl_sect : OPEN DELIM TAG_TITL mand_line_item
 obje_blob_sect : OPEN DELIM TAG_BLOB
                  { $<ctxt>$ = start_element(ELT_OBJE_BLOB,
                                            PARENT, $1, $3, NULL,
-                                           GEDCOM_MAKE_NULL());
+                                           GEDCOM_MAKE_NULL(val1));
                   START(BLOB, $<ctxt>$)              
                 }
                  obje_blob_subs
@@ -1206,7 +1250,7 @@ obje_blob_sub  : obje_blob_cont_sect  { OCCUR1(CONT, 1) }
 obje_blob_cont_sect : OPEN DELIM TAG_CONT mand_line_item        
                       { $<ctxt>$ = start_element(ELT_OBJE_BLOB_CONT,
                                                 PARENT, $1, $3, $4, 
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(CONT, $<ctxt>$)               
                      }                
                      no_std_subs                
@@ -1219,9 +1263,12 @@ obje_blob_cont_sect : OPEN DELIM TAG_CONT mand_line_item
 
 /* OBJE.OBJE */
 obje_obje_sect : OPEN DELIM TAG_OBJE mand_pointer 
-                 { $<ctxt>$ = start_element(ELT_OBJE_OBJE,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_OBJE);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_OBJE_OBJE,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(OBJE, $<ctxt>$)  
                  }  
                  no_std_subs  
@@ -1235,9 +1282,12 @@ obje_obje_sect : OPEN DELIM TAG_OBJE mand_pointer
 /**** Note record                                                 ****/
 /*********************************************************************/
 note_rec    : OPEN DELIM POINTER DELIM TAG_NOTE note_line_item
-              { $<ctxt>$ = start_record(REC_NOTE,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       $6, GEDCOM_MAKE_STRING($6));
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_NOTE);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_NOTE,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       $6, GEDCOM_MAKE_STRING(val2, $6));
                START(NOTE, $<ctxt>$) }
               note_subs
              { CHECK0 }
@@ -1249,6 +1299,9 @@ note_line_item : /* empty */
                    { if (!compat_mode(C_FTREE)) {
                       gedcom_error(_("Missing value")); YYERROR;
                     }
+                    else {
+                      $$ = "";
+                    }
                   }
                | DELIM line_item
                    { gedcom_debug_print("==Val: %s==", $2);
@@ -1270,9 +1323,12 @@ note_sub    : continuation_sub  /* 0:M */
 /**** Repository record                                           ****/
 /*********************************************************************/
 repos_rec   : OPEN DELIM POINTER DELIM TAG_REPO
-              { $<ctxt>$ = start_record(REC_REPO,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       NULL, GEDCOM_MAKE_NULL());
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_REPO);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_REPO,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       NULL, GEDCOM_MAKE_NULL(val2));
                START(REPO, $<ctxt>$) }
               repo_subs
              { CHECK0 }
@@ -1296,7 +1352,7 @@ repo_sub    : repo_name_sect  { OCCUR2(NAME, 0, 1) }
 repo_name_sect : OPEN DELIM TAG_NAME mand_line_item         
                  { $<ctxt>$ = start_element(ELT_REPO_NAME,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(NAME, $<ctxt>$)          
                  }          
                  no_std_subs          
@@ -1310,9 +1366,12 @@ repo_name_sect : OPEN DELIM TAG_NAME mand_line_item
 /**** Source record                                               ****/
 /*********************************************************************/
 source_rec  : OPEN DELIM POINTER DELIM TAG_SOUR
-              { $<ctxt>$ = start_record(REC_SOUR,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       NULL, GEDCOM_MAKE_NULL());
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_SOUR);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_SOUR,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       NULL, GEDCOM_MAKE_NULL(val2));
                START(SOUR, $<ctxt>$) }
               sour_subs
              { CHECK0 }
@@ -1342,7 +1401,7 @@ sour_sub    : sour_data_sect  { OCCUR2(DATA, 0, 1) }
 sour_data_sect : OPEN DELIM TAG_DATA
                  { $<ctxt>$ = start_element(ELT_SOUR_DATA,
                                            PARENT, $1, $3, NULL,
-                                           GEDCOM_MAKE_NULL());
+                                           GEDCOM_MAKE_NULL(val1));
                   START(DATA, $<ctxt>$) 
                  }
                  sour_data_subs
@@ -1365,7 +1424,7 @@ sour_data_sub  : sour_data_even_sect  /* 0:M */
 sour_data_even_sect : OPEN DELIM TAG_EVEN mand_line_item 
                       { $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN,
                                                 PARENT, $1, $3, $4, 
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(EVEN, $<ctxt>$)  
                       }
                       sour_data_even_subs
@@ -1387,9 +1446,10 @@ sour_data_even_sub  : sour_data_even_date_sect { OCCUR2(DATE, 0, 1) }
 
 sour_data_even_date_sect : OPEN DELIM TAG_DATE mand_line_item          
                            { struct date_value dv = gedcom_parse_date($4);
-                            $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN_DATE,
-                                                     PARENT, $1, $3, $4, 
-                                                     GEDCOM_MAKE_DATE(dv));
+                            $<ctxt>$
+                              = start_element(ELT_SOUR_DATA_EVEN_DATE,
+                                              PARENT, $1, $3, $4, 
+                                              GEDCOM_MAKE_DATE(val1, dv));
                             START(DATE, $<ctxt>$)           
                            }           
                            no_std_subs           
@@ -1401,9 +1461,10 @@ sour_data_even_date_sect : OPEN DELIM TAG_DATE mand_line_item
                          ;
 
 sour_data_even_plac_sect : OPEN DELIM TAG_PLAC mand_line_item          
-                           { $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN_PLAC,
-                                                     PARENT, $1, $3, $4, 
-                                                     GEDCOM_MAKE_STRING($4));
+                           { $<ctxt>$
+                              = start_element(ELT_SOUR_DATA_EVEN_PLAC,
+                                              PARENT, $1, $3, $4, 
+                                              GEDCOM_MAKE_STRING(val1, $4));
                             START(PLAC, $<ctxt>$)           
                            }           
                            no_std_subs           
@@ -1417,7 +1478,7 @@ sour_data_even_plac_sect : OPEN DELIM TAG_PLAC mand_line_item
 sour_data_agnc_sect : OPEN DELIM TAG_AGNC mand_line_item          
                       { $<ctxt>$ = start_element(ELT_SOUR_DATA_AGNC,
                                                 PARENT, $1, $3, $4, 
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(AGNC, $<ctxt>$)           
                       }           
                       no_std_subs           
@@ -1432,7 +1493,7 @@ sour_data_agnc_sect : OPEN DELIM TAG_AGNC mand_line_item
 sour_auth_sect : OPEN DELIM TAG_AUTH mand_line_item
                  { $<ctxt>$ = start_element(ELT_SOUR_AUTH,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(AUTH, $<ctxt>$) 
                  }
                  sour_auth_subs
@@ -1454,7 +1515,7 @@ sour_auth_sub  : continuation_sub  /* 0:M */
 sour_titl_sect : OPEN DELIM TAG_TITL mand_line_item  
                  { $<ctxt>$ = start_element(ELT_SOUR_TITL,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(TITL, $<ctxt>$)   
                  }
                  sour_titl_subs 
@@ -1476,7 +1537,7 @@ sour_titl_sub  : continuation_sub  /* 0:M */
 sour_abbr_sect : OPEN DELIM TAG_ABBR mand_line_item           
                  { $<ctxt>$ = start_element(ELT_SOUR_ABBR,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(ABBR, $<ctxt>$)            
                  }            
                  no_std_subs            
@@ -1490,7 +1551,7 @@ sour_abbr_sect : OPEN DELIM TAG_ABBR mand_line_item
 sour_publ_sect : OPEN DELIM TAG_PUBL mand_line_item  
                  { $<ctxt>$ = start_element(ELT_SOUR_PUBL,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(PUBL, $<ctxt>$)            
                  }
                  sour_publ_subs  
@@ -1512,7 +1573,7 @@ sour_publ_sub  : continuation_sub  /* 0:M */
 sour_text_sect : OPEN DELIM TAG_TEXT mand_line_item   
                  { $<ctxt>$ = start_element(ELT_SOUR_TEXT,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(TEXT, $<ctxt>$)    
                  }
                  sour_text_subs  
@@ -1534,9 +1595,12 @@ sour_text_sub  : continuation_sub  /* 0:M */
 /**** Submission record                                           ****/
 /*********************************************************************/
 submis_rec  : OPEN DELIM POINTER DELIM TAG_SUBN    
-              { $<ctxt>$ = start_record(REC_SUBN,
-                                       $1, GEDCOM_MAKE_STRING($3), $5,
-                                       NULL, GEDCOM_MAKE_NULL());
+              { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                         XREF_SUBN);
+               if (xr == NULL) HANDLE_ERROR;
+               $<ctxt>$ = start_record(REC_SUBN,
+                                       $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                       NULL, GEDCOM_MAKE_NULL(val2));
                START(SUBN, $<ctxt>$) }
               subn_subs
              { CHECK0 }
@@ -1560,9 +1624,12 @@ subn_sub    : subn_subm_sect  { OCCUR2(SUBM, 0, 1) }
 
 /* SUBN.SUBM */
 subn_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
-                 { $<ctxt>$ = start_element(ELT_SUBN_SUBM,
+                 { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                            XREF_SUBM);
+                  if (xr == NULL) HANDLE_ERROR;
+                  $<ctxt>$ = start_element(ELT_SUBN_SUBM,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                   START(SUBM, $<ctxt>$) 
                  } 
                  no_std_subs 
@@ -1576,7 +1643,7 @@ subn_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
 subn_famf_sect : OPEN DELIM TAG_FAMF mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_FAMF,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(FAMF, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1590,7 +1657,7 @@ subn_famf_sect : OPEN DELIM TAG_FAMF mand_line_item
 subn_temp_sect : OPEN DELIM TAG_TEMP mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_TEMP,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(TEMP, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1604,7 +1671,7 @@ subn_temp_sect : OPEN DELIM TAG_TEMP mand_line_item
 subn_ance_sect : OPEN DELIM TAG_ANCE mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_ANCE,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(ANCE, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1618,7 +1685,7 @@ subn_ance_sect : OPEN DELIM TAG_ANCE mand_line_item
 subn_desc_sect : OPEN DELIM TAG_DESC mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_DESC,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(DESC, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1632,7 +1699,7 @@ subn_desc_sect : OPEN DELIM TAG_DESC mand_line_item
 subn_ordi_sect : OPEN DELIM TAG_ORDI mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_ORDI,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(ORDI, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1646,7 +1713,7 @@ subn_ordi_sect : OPEN DELIM TAG_ORDI mand_line_item
 subn_rin_sect  : OPEN DELIM TAG_RIN mand_line_item            
                  { $<ctxt>$ = start_element(ELT_SUBN_RIN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RIN, $<ctxt>$)             
                  }             
                  no_std_subs             
@@ -1660,9 +1727,12 @@ subn_rin_sect  : OPEN DELIM TAG_RIN mand_line_item
 /**** Submitter record                                            ****/
 /*********************************************************************/
 submit_rec : OPEN DELIM POINTER DELIM TAG_SUBM    
-             { $<ctxt>$ = start_record(REC_SUBM,
-                                      $1, GEDCOM_MAKE_STRING($3), $5,
-                                      NULL, GEDCOM_MAKE_NULL());
+             { struct xref_value *xr = gedcom_parse_xref($3, XREF_DEFINED,
+                                                        XREF_SUBM);
+              if (xr == NULL) HANDLE_ERROR;
+              $<ctxt>$ = start_record(REC_SUBM,
+                                      $1, GEDCOM_MAKE_XREF_PTR(val1, xr), $5,
+                                      NULL, GEDCOM_MAKE_NULL(val2));
                START(SUBM, $<ctxt>$) }
              subm_subs
             { CHECK1(NAME) }
@@ -1688,7 +1758,7 @@ subm_sub   : subm_name_sect  { OCCUR2(NAME, 0, 1) }
 subm_name_sect : OPEN DELIM TAG_NAME mand_line_item             
                  { $<ctxt>$ = start_element(ELT_SUBM_NAME,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(NAME, $<ctxt>$)              
                  }              
                  no_std_subs              
@@ -1702,7 +1772,7 @@ subm_name_sect : OPEN DELIM TAG_NAME mand_line_item
 subm_lang_sect : OPEN DELIM TAG_LANG mand_line_item             
                  { $<ctxt>$ = start_element(ELT_SUBM_LANG,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(LANG, $<ctxt>$)              
                  }              
                  no_std_subs              
@@ -1716,7 +1786,7 @@ subm_lang_sect : OPEN DELIM TAG_LANG mand_line_item
 subm_rfn_sect  : OPEN DELIM TAG_RFN mand_line_item             
                  { $<ctxt>$ = start_element(ELT_SUBM_RFN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RFN, $<ctxt>$)              
                  }              
                  no_std_subs              
@@ -1730,7 +1800,7 @@ subm_rfn_sect  : OPEN DELIM TAG_RFN mand_line_item
 subm_rin_sect  : OPEN DELIM TAG_RIN mand_line_item             
                  { $<ctxt>$ = start_element(ELT_SUBM_RIN,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RIN, $<ctxt>$)              
                  }              
                  no_std_subs              
@@ -1752,7 +1822,7 @@ addr_struc_sub : addr_sect { OCCUR2(ADDR, 0, 1) }
 addr_sect   : OPEN DELIM TAG_ADDR mand_line_item 
               { $<ctxt>$ = start_element(ELT_SUB_ADDR,
                                         PARENT, $1, $3, $4, 
-                                        GEDCOM_MAKE_STRING($4));
+                                        GEDCOM_MAKE_STRING(val1, $4));
                START(ADDR, $<ctxt>$)  
               }
               addr_subs
@@ -1779,7 +1849,7 @@ addr_sub    : addr_cont_sect  /* 0:M */
 addr_cont_sect : OPEN DELIM TAG_CONT mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_CONT,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(CONT, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1791,7 +1861,7 @@ addr_cont_sect : OPEN DELIM TAG_CONT mand_line_item
 addr_adr1_sect : OPEN DELIM TAG_ADR1 mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_ADR1,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(ADR1, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1803,7 +1873,7 @@ addr_adr1_sect : OPEN DELIM TAG_ADR1 mand_line_item
 addr_adr2_sect : OPEN DELIM TAG_ADR2 mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_ADR2,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(ADR2, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1815,7 +1885,7 @@ addr_adr2_sect : OPEN DELIM TAG_ADR2 mand_line_item
 addr_city_sect : OPEN DELIM TAG_CITY mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_CITY,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(CITY, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1827,7 +1897,7 @@ addr_city_sect : OPEN DELIM TAG_CITY mand_line_item
 addr_stae_sect : OPEN DELIM TAG_STAE mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_STAE,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(STAE, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1839,7 +1909,7 @@ addr_stae_sect : OPEN DELIM TAG_STAE mand_line_item
 addr_post_sect : OPEN DELIM TAG_POST mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_POST,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(POST, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1851,7 +1921,7 @@ addr_post_sect : OPEN DELIM TAG_POST mand_line_item
 addr_ctry_sect : OPEN DELIM TAG_CTRY mand_line_item              
                  { $<ctxt>$ = start_element(ELT_SUB_ADDR_CTRY,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(CTRY, $<ctxt>$)               
                  }               
                  no_std_subs               
@@ -1864,7 +1934,7 @@ addr_ctry_sect : OPEN DELIM TAG_CTRY mand_line_item
 phon_sect   : OPEN DELIM TAG_PHON mand_line_item              
               { $<ctxt>$ = start_element(ELT_SUB_PHON,
                                         PARENT, $1, $3, $4, 
-                                        GEDCOM_MAKE_STRING($4));
+                                        GEDCOM_MAKE_STRING(val1, $4));
                START(PHON, $<ctxt>$)               
               }               
               no_std_subs               
@@ -1879,9 +1949,12 @@ assoc_struc_sub : asso_sect /* 0:M */
                 ;
 
 asso_sect : OPEN DELIM TAG_ASSO mand_pointer
-            { $<ctxt>$ = start_element(ELT_SUB_ASSO,
+            { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                       XREF_INDI);
+             if (xr == NULL) HANDLE_ERROR;
+             $<ctxt>$ = start_element(ELT_SUB_ASSO,
                                       PARENT, $1, $3, $4, 
-                                      GEDCOM_MAKE_STRING($4));
+                                      GEDCOM_MAKE_XREF_PTR(val1, xr));
              START(ASSO, $<ctxt>$) 
             }
             asso_subs
@@ -1902,7 +1975,7 @@ asso_subs : /* empty */
 asso_type_sect : OPEN DELIM TAG_TYPE mand_line_item               
                  { $<ctxt>$ = start_element(ELT_SUB_ASSO_TYPE,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(TYPE, $<ctxt>$)                
                  }                
                  no_std_subs                
@@ -1915,7 +1988,7 @@ asso_type_sect : OPEN DELIM TAG_TYPE mand_line_item
 asso_rela_sect : OPEN DELIM TAG_RELA mand_line_item               
                  { $<ctxt>$ = start_element(ELT_SUB_ASSO_RELA,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(RELA, $<ctxt>$)                
                  }                
                  no_std_subs                
@@ -1932,7 +2005,7 @@ change_date_sub : change_date_chan_sect  { OCCUR2(CHAN, 0, 1) }
 change_date_chan_sect : OPEN DELIM TAG_CHAN
                         { $<ctxt>$ = start_element(ELT_SUB_CHAN,
                                                   PARENT, $1, $3, NULL, 
-                                                  GEDCOM_MAKE_NULL());
+                                                  GEDCOM_MAKE_NULL(val1));
                          START(CHAN, $<ctxt>$) 
                         }
                         change_date_chan_subs
@@ -1955,7 +2028,7 @@ change_date_date_sect : OPEN DELIM TAG_DATE mand_line_item
                         { struct date_value dv = gedcom_parse_date($4);
                          $<ctxt>$ = start_element(ELT_SUB_CHAN_DATE,
                                                   PARENT, $1, $3, $4, 
-                                                  GEDCOM_MAKE_DATE(dv));
+                                                  GEDCOM_MAKE_DATE(val1, dv));
                          START(DATE, $<ctxt>$) }
                         change_date_date_subs
                        { CHECK0 }
@@ -1977,7 +2050,7 @@ change_date_date_time_sect : OPEN DELIM TAG_TIME mand_line_item
                              { $<ctxt>$
                                 = start_element(ELT_SUB_CHAN_TIME,
                                                 PARENT, $1, $3, $4, 
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                               START(TIME, $<ctxt>$) 
                              } 
                              no_std_subs 
@@ -1993,9 +2066,12 @@ chi_fam_link_sub : famc_sect  /* 0:M */
                  ;
 
 famc_sect : OPEN DELIM TAG_FAMC mand_pointer
-            { $<ctxt>$ = start_element(ELT_SUB_FAMC,
+            { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                         XREF_FAM);
+             if (xr == NULL) HANDLE_ERROR;
+             $<ctxt>$ = start_element(ELT_SUB_FAMC,
                                       PARENT, $1, $3, $4, 
-                                      GEDCOM_MAKE_STRING($4));
+                                      GEDCOM_MAKE_XREF_PTR(val1, xr));
              START(FAMC, $<ctxt>$) 
             }
             famc_subs
@@ -2017,7 +2093,7 @@ famc_sub  : famc_pedi_sect  /* 0:M */
 famc_pedi_sect : OPEN DELIM TAG_PEDI mand_line_item 
                  { $<ctxt>$ = start_element(ELT_SUB_FAMC_PEDI,
                                            PARENT, $1, $3, $4, 
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(PEDI, $<ctxt>$)  
                  }  
                  no_std_subs  
@@ -2035,7 +2111,7 @@ continuation_sub : cont_sect  /* 0:M */
 cont_sect : OPEN DELIM TAG_CONT mand_line_item 
             { $<ctxt>$ = start_element(ELT_SUB_CONT,
                                       PARENT, $1, $3, $4, 
-                                      GEDCOM_MAKE_STRING($4));
+                                      GEDCOM_MAKE_STRING(val1, $4));
              START(CONT, $<ctxt>$)  
             }  
             no_std_subs  
@@ -2048,7 +2124,7 @@ cont_sect : OPEN DELIM TAG_CONT mand_line_item
 conc_sect : OPEN DELIM TAG_CONC mand_line_item 
             { $<ctxt>$ = start_element(ELT_SUB_CONC,
                                       PARENT, $1, $3, $4, 
-                                      GEDCOM_MAKE_STRING($4));
+                                      GEDCOM_MAKE_STRING(val1, $4));
              START(CONC, $<ctxt>$)  
             }  
             no_std_subs  
@@ -2072,9 +2148,10 @@ event_detail_sub : event_detail_type_sect  { OCCUR2(TYPE, 0, 1) }
                  ;
 
 event_detail_type_sect : OPEN DELIM TAG_TYPE mand_line_item 
-                         { $<ctxt>$ = start_element(ELT_SUB_EVT_TYPE,
-                                                   PARENT, $1, $3, $4, 
-                                                   GEDCOM_MAKE_STRING($4));
+                         { $<ctxt>$
+                            = start_element(ELT_SUB_EVT_TYPE,
+                                            PARENT, $1, $3, $4, 
+                                            GEDCOM_MAKE_STRING(val1, $4));
                           START(TYPE, $<ctxt>$)  
                          }  
                          no_std_subs  
@@ -2086,9 +2163,10 @@ event_detail_type_sect : OPEN DELIM TAG_TYPE mand_line_item
                        ;
 event_detail_date_sect : OPEN DELIM TAG_DATE mand_line_item 
                          { struct date_value dv = gedcom_parse_date($4);
-                          $<ctxt>$ = start_element(ELT_SUB_EVT_DATE,
-                                                   PARENT, $1, $3, $4, 
-                                                   GEDCOM_MAKE_DATE(dv));
+                          $<ctxt>$
+                            = start_element(ELT_SUB_EVT_DATE,
+                                            PARENT, $1, $3, $4, 
+                                            GEDCOM_MAKE_DATE(val1, dv));
                           START(DATE, $<ctxt>$)  
                          }  
                          no_std_subs  
@@ -2099,9 +2177,10 @@ event_detail_date_sect : OPEN DELIM TAG_DATE mand_line_item
                         }
                        ;
 event_detail_age_sect  : OPEN DELIM TAG_AGE mand_line_item 
-                         { $<ctxt>$ = start_element(ELT_SUB_EVT_AGE,
-                                                   PARENT, $1, $3, $4, 
-                                                   GEDCOM_MAKE_STRING($4));
+                         { $<ctxt>$
+                            = start_element(ELT_SUB_EVT_AGE,
+                                            PARENT, $1, $3, $4, 
+                                            GEDCOM_MAKE_STRING(val1, $4));
                           START(AGE, $<ctxt>$)  
                          }  
                          no_std_subs  
@@ -2112,9 +2191,10 @@ event_detail_age_sect  : OPEN DELIM TAG_AGE mand_line_item
                         }
                        ;
 event_detail_agnc_sect : OPEN DELIM TAG_AGNC mand_line_item 
-                         { $<ctxt>$ = start_element(ELT_SUB_EVT_AGNC,
-                                                   PARENT, $1, $3, $4, 
-                                                   GEDCOM_MAKE_STRING($4));
+                         { $<ctxt>$
+                            = start_element(ELT_SUB_EVT_AGNC,
+                                            PARENT, $1, $3, $4, 
+                                            GEDCOM_MAKE_STRING(val1, $4));
                           START(AGNC, $<ctxt>$)  
                          }  
                          no_std_subs  
@@ -2125,9 +2205,10 @@ event_detail_agnc_sect : OPEN DELIM TAG_AGNC mand_line_item
                         }
                        ;
 event_detail_caus_sect : OPEN DELIM TAG_CAUS mand_line_item 
-                         { $<ctxt>$ = start_element(ELT_SUB_EVT_CAUS,
-                                                   PARENT, $1, $3, $4, 
-                                                   GEDCOM_MAKE_STRING($4));
+                         { $<ctxt>$
+                            = start_element(ELT_SUB_EVT_CAUS,
+                                            PARENT, $1, $3, $4, 
+                                            GEDCOM_MAKE_STRING(val1, $4));
                           START(CAUS, $<ctxt>$)  
                          }  
                          no_std_subs  
@@ -2144,10 +2225,10 @@ fam_event_struc_sub : fam_event_sect
                     ;
 
 fam_event_sect : OPEN DELIM fam_event_tag opt_value  
-                 { 
-                  $<ctxt>$ = start_element(ELT_SUB_FAM_EVT,
-                                           PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_NULL_OR_STRING($4));
+                 { $<ctxt>$
+                    = start_element(ELT_SUB_FAM_EVT,
+                                    PARENT, $1, $3, $4,
+                                    GEDCOM_MAKE_NULL_OR_STRING(val1, $4));
                   START2($<ctxt>$);
                 }
                  fam_event_subs
@@ -2182,7 +2263,7 @@ fam_event_sub : event_detail_sub
 fam_even_husb_sect : OPEN DELIM TAG_HUSB
                      { $<ctxt>$ = start_element(ELT_SUB_FAM_EVT_HUSB,
                                                PARENT, $1, $3, NULL,
-                                               GEDCOM_MAKE_NULL());
+                                               GEDCOM_MAKE_NULL(val1));
                       START(HUSB, $<ctxt>$) 
                      }
                      fam_even_husb_subs
@@ -2204,7 +2285,7 @@ fam_even_husb_sub : fam_even_age_sect  { OCCUR2(AGE, 1, 1) }
 fam_even_age_sect : OPEN DELIM TAG_AGE mand_line_item  
                     { $<ctxt>$ = start_element(ELT_SUB_FAM_EVT_AGE,
                                               PARENT, $1, $3, $4,
-                                              GEDCOM_MAKE_STRING($4));
+                                              GEDCOM_MAKE_STRING(val1, $4));
                      START(AGE, $<ctxt>$)   
                     }   
                     no_std_subs   
@@ -2218,7 +2299,7 @@ fam_even_age_sect : OPEN DELIM TAG_AGE mand_line_item
 fam_even_wife_sect : OPEN DELIM TAG_WIFE
                      { $<ctxt>$ = start_element(ELT_SUB_FAM_EVT_WIFE,
                                                PARENT, $1, $3, NULL,
-                                               GEDCOM_MAKE_NULL());
+                                               GEDCOM_MAKE_NULL(val1));
                       START(WIFE, $<ctxt>$) 
                      }
                      fam_even_husb_subs
@@ -2232,7 +2313,7 @@ fam_even_wife_sect : OPEN DELIM TAG_WIFE
 fam_gen_even_sect : OPEN DELIM TAG_EVEN
                     { $<ctxt>$ = start_element(ELT_SUB_FAM_EVT_EVEN,
                                                PARENT, $1, $3, NULL,
-                                               GEDCOM_MAKE_NULL());
+                                               GEDCOM_MAKE_NULL(val1));
                       START(EVEN, $<ctxt>$) 
                     }
                     fam_gen_even_subs
@@ -2261,7 +2342,7 @@ ident_struc_sub : ident_refn_sect  /* 0:M */
 ident_refn_sect : OPEN DELIM TAG_REFN mand_line_item 
                   { $<ctxt>$ = start_element(ELT_SUB_IDENT_REFN,
                                             PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_STRING($4));
+                                            GEDCOM_MAKE_STRING(val1, $4));
                    START(REFN, $<ctxt>$)  
                   }
                   ident_refn_subs
@@ -2281,9 +2362,10 @@ ident_refn_sub  : ident_refn_type_sect  { OCCUR2(TYPE, 0, 1) }
                 ;
 
 ident_refn_type_sect : OPEN DELIM TAG_TYPE mand_line_item   
-                       { $<ctxt>$ = start_element(ELT_SUB_IDENT_REFN_TYPE,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_IDENT_REFN_TYPE,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(TYPE, $<ctxt>$)    
                        }    
                        no_std_subs    
@@ -2297,7 +2379,7 @@ ident_refn_type_sect : OPEN DELIM TAG_TYPE mand_line_item
 ident_rin_sect  : OPEN DELIM TAG_RIN mand_line_item   
                   { $<ctxt>$ = start_element(ELT_SUB_IDENT_RIN,
                                             PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_STRING($4));
+                                            GEDCOM_MAKE_STRING(val1, $4));
                    START(RIN, $<ctxt>$)    
                   }    
                   no_std_subs    
@@ -2316,7 +2398,7 @@ indiv_attr_struc_sub : indiv_attr_sect   /* 0:M */
 indiv_attr_sect : OPEN DELIM indiv_attr_tag mand_line_item
                   { $<ctxt>$ = start_element(ELT_SUB_INDIV_ATTR,
                                             PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_STRING($4));
+                                            GEDCOM_MAKE_STRING(val1, $4));
                    START2($<ctxt>$);
                  }
                   indiv_attr_event_subs
@@ -2341,7 +2423,7 @@ indiv_attr_tag  : TAG_CAST { $$ = $1; START1(CAST) }
 indiv_resi_sect : OPEN DELIM TAG_RESI 
                   { $<ctxt>$ = start_element(ELT_SUB_INDIV_RESI,
                                             PARENT, $1, $3, NULL,
-                                            GEDCOM_MAKE_NULL());
+                                            GEDCOM_MAKE_NULL(val1));
                    START(RESI, $<ctxt>$)  
                   }
                   indiv_attr_event_subs 
@@ -2367,9 +2449,10 @@ indiv_even_struc_sub : indiv_birt_sect
                      ;
 
 indiv_birt_sect : OPEN DELIM indiv_birt_tag opt_value 
-                  { $<ctxt>$ = start_element(ELT_SUB_INDIV_BIRT,
-                                            PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_NULL_OR_STRING($4));
+                  { $<ctxt>$
+                     = start_element(ELT_SUB_INDIV_BIRT,
+                                     PARENT, $1, $3, $4,
+                                     GEDCOM_MAKE_NULL_OR_STRING(val1, $4));
                    START2($<ctxt>$);
                  }
                   indiv_birt_subs
@@ -2393,9 +2476,14 @@ indiv_birt_sub  : event_detail_sub
                 ;
 
 indiv_birt_famc_sect : OPEN DELIM TAG_FAMC mand_pointer
-                       { $<ctxt>$ = start_element(ELT_SUB_INDIV_BIRT_FAMC,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { struct xref_value *xr = gedcom_parse_xref($4,
+                                                                  XREF_USED,
+                                                                  XREF_FAM);
+                        if (xr == NULL) HANDLE_ERROR;
+                        $<ctxt>$
+                          = start_element(ELT_SUB_INDIV_BIRT_FAMC,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                         START(FAMC, $<ctxt>$) 
                        } 
                        no_std_subs 
@@ -2407,9 +2495,10 @@ indiv_birt_famc_sect : OPEN DELIM TAG_FAMC mand_pointer
                      ;
 
 indiv_gen_sect  : OPEN DELIM indiv_gen_tag opt_value 
-                  { $<ctxt>$ = start_element(ELT_SUB_INDIV_GEN,
-                                            PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_NULL_OR_STRING($4));
+                  { $<ctxt>$
+                     = start_element(ELT_SUB_INDIV_GEN,
+                                     PARENT, $1, $3, $4,
+                                     GEDCOM_MAKE_NULL_OR_STRING(val1, $4));
                    START2($<ctxt>$);
                  }
                   indiv_gen_subs
@@ -2449,9 +2538,10 @@ indiv_gen_sub   : event_detail_sub
                 ;
 
 indiv_adop_sect : OPEN DELIM TAG_ADOP opt_value 
-                  { $<ctxt>$ = start_element(ELT_SUB_INDIV_ADOP,
-                                            PARENT, $1, $3, $4,
-                                            GEDCOM_MAKE_NULL_OR_STRING($4));
+                  { $<ctxt>$
+                     = start_element(ELT_SUB_INDIV_ADOP,
+                                     PARENT, $1, $3, $4,
+                                     GEDCOM_MAKE_NULL_OR_STRING(val1, $4));
                    START(ADOP, $<ctxt>$) }
                   indiv_adop_subs
                  { CHECK0 }
@@ -2470,9 +2560,14 @@ indiv_adop_sub  : event_detail_sub
                 ;
 
 indiv_adop_famc_sect : OPEN DELIM TAG_FAMC mand_pointer
-                       { $<ctxt>$ = start_element(ELT_SUB_INDIV_ADOP_FAMC,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { struct xref_value *xr = gedcom_parse_xref($4,
+                                                                  XREF_USED,
+                                                                  XREF_FAM);
+                        if (xr == NULL) HANDLE_ERROR;
+                        $<ctxt>$
+                          = start_element(ELT_SUB_INDIV_ADOP_FAMC,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                         START(FAMC, $<ctxt>$) }
                        indiv_adop_famc_subs
                       { CHECK0 }
@@ -2494,7 +2589,7 @@ indiv_adop_famc_adop_sect : OPEN DELIM TAG_ADOP mand_line_item
                             { $<ctxt>$
                                = start_element(ELT_SUB_INDIV_ADOP_FAMC_ADOP,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                              START(ADOP, $<ctxt>$) }    
                             no_std_subs    
                             { CHECK0 }    
@@ -2507,7 +2602,7 @@ indiv_adop_famc_adop_sect : OPEN DELIM TAG_ADOP mand_line_item
 indiv_even_sect : OPEN DELIM TAG_EVEN
                   { $<ctxt>$ = start_element(ELT_SUB_INDIV_EVEN,
                                             PARENT, $1, $3, NULL,
-                                            GEDCOM_MAKE_NULL());
+                                            GEDCOM_MAKE_NULL(val1));
                    START(EVEN, $<ctxt>$) }
                   indiv_gen_subs
                  { CHECK0 }
@@ -2524,7 +2619,7 @@ lds_indiv_ord_sub : lio_bapl_sect  /* 0:M */
 lio_bapl_sect : OPEN DELIM lio_bapl_tag 
                 { $<ctxt>$ = start_element(ELT_SUB_LIO_BAPL,
                                           PARENT, $1, $3, NULL,
-                                          GEDCOM_MAKE_NULL());
+                                          GEDCOM_MAKE_NULL(val1));
                  START2($<ctxt>$);
                }
                 lio_bapl_subs
@@ -2555,7 +2650,7 @@ lio_bapl_sub  : lio_bapl_stat_sect  { OCCUR2(STAT, 0, 1) }
 lio_bapl_stat_sect : OPEN DELIM TAG_STAT mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LIO_BAPL_STAT,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(STAT, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2569,7 +2664,7 @@ lio_bapl_date_sect : OPEN DELIM TAG_DATE mand_line_item
                      { struct date_value dv = gedcom_parse_date($4);
                       $<ctxt>$ = start_element(ELT_SUB_LIO_BAPL_DATE,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_DATE(dv));
+                                               GEDCOM_MAKE_DATE(val1, dv));
                       START(DATE, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2582,7 +2677,7 @@ lio_bapl_date_sect : OPEN DELIM TAG_DATE mand_line_item
 lio_bapl_temp_sect : OPEN DELIM TAG_TEMP mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LIO_BAPL_TEMP,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(TEMP, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2595,7 +2690,7 @@ lio_bapl_temp_sect : OPEN DELIM TAG_TEMP mand_line_item
 lio_bapl_plac_sect : OPEN DELIM TAG_PLAC mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LIO_BAPL_PLAC,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(PLAC, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2609,7 +2704,7 @@ lio_bapl_plac_sect : OPEN DELIM TAG_PLAC mand_line_item
 lio_slgc_sect : OPEN DELIM TAG_SLGC
                 { $<ctxt>$ = start_element(ELT_SUB_LIO_SLGC,
                                           PARENT, $1, $3, NULL,
-                                          GEDCOM_MAKE_NULL());
+                                          GEDCOM_MAKE_NULL(val1));
                  START(SLGC, $<ctxt>$) 
                 }
                 lio_slgc_subs
@@ -2628,9 +2723,13 @@ lio_slgc_sub  : lio_bapl_sub
               ;
 
 lio_slgc_famc_sect : OPEN DELIM TAG_FAMC mand_pointer
-                     { $<ctxt>$ = start_element(ELT_SUB_LIO_SLGC_FAMC,
-                                               PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                     { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                                XREF_FAM);
+                      if (xr == NULL) HANDLE_ERROR;
+                      $<ctxt>$
+                        = start_element(ELT_SUB_LIO_SLGC_FAMC,
+                                        PARENT, $1, $3, $4,
+                                        GEDCOM_MAKE_XREF_PTR(val1, xr));
                       START(FAMC, $<ctxt>$) 
                      } 
                      no_std_subs 
@@ -2648,7 +2747,7 @@ lds_spouse_seal_sub : lss_slgs_sect
 lss_slgs_sect : OPEN DELIM TAG_SLGS
                 { $<ctxt>$ = start_element(ELT_SUB_LSS_SLGS,
                                           PARENT, $1, $3, NULL,
-                                          GEDCOM_MAKE_NULL());
+                                          GEDCOM_MAKE_NULL(val1));
                  START(SLGS, $<ctxt>$) }
                 lss_slgs_subs
                { CHECK0 }
@@ -2673,7 +2772,7 @@ lss_slgs_sub  : lss_slgs_stat_sect  { OCCUR2(STAT, 0, 1) }
 lss_slgs_stat_sect : OPEN DELIM TAG_STAT mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LSS_SLGS_STAT,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(STAT, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2687,7 +2786,7 @@ lss_slgs_date_sect : OPEN DELIM TAG_DATE mand_line_item
                      { struct date_value dv = gedcom_parse_date($4);
                       $<ctxt>$ = start_element(ELT_SUB_LSS_SLGS_DATE,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_DATE(dv));
+                                               GEDCOM_MAKE_DATE(val1, dv));
                       START(DATE, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2700,7 +2799,7 @@ lss_slgs_date_sect : OPEN DELIM TAG_DATE mand_line_item
 lss_slgs_temp_sect : OPEN DELIM TAG_TEMP mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LSS_SLGS_TEMP,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(TEMP, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2713,7 +2812,7 @@ lss_slgs_temp_sect : OPEN DELIM TAG_TEMP mand_line_item
 lss_slgs_plac_sect : OPEN DELIM TAG_PLAC mand_line_item   
                      { $<ctxt>$ = start_element(ELT_SUB_LSS_SLGS_PLAC,
                                                PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                                               GEDCOM_MAKE_STRING(val1, $4));
                       START(PLAC, $<ctxt>$)    
                      }    
                      no_std_subs    
@@ -2730,9 +2829,14 @@ multim_link_sub : multim_obje_link_sect
                 ;
 
 multim_obje_link_sect : OPEN DELIM TAG_OBJE DELIM POINTER    
-                        { $<ctxt>$ = start_element(ELT_SUB_MULTIM_OBJE,
-                                                  PARENT, $1, $3, $5,
-                                                  GEDCOM_MAKE_STRING($5));
+                        { struct xref_value *xr = gedcom_parse_xref($5,
+                                                                   XREF_USED,
+                                                                   XREF_OBJE);
+                         if (xr == NULL) HANDLE_ERROR;
+                         $<ctxt>$
+                           = start_element(ELT_SUB_MULTIM_OBJE,
+                                           PARENT, $1, $3, $5,
+                                           GEDCOM_MAKE_XREF_PTR(val1, xr));
                          START(OBJE, $<ctxt>$)     
                         }     
                         no_std_subs     
@@ -2746,7 +2850,7 @@ multim_obje_link_sect : OPEN DELIM TAG_OBJE DELIM POINTER
 multim_obje_emb_sect : OPEN DELIM TAG_OBJE
                        { $<ctxt>$ = start_element(ELT_SUB_MULTIM_OBJE,
                                                  PARENT, $1, $3, NULL,
-                                                 GEDCOM_MAKE_NULL());
+                                                 GEDCOM_MAKE_NULL(val1));
                         START(OBJE, $<ctxt>$) 
                        }
                        multim_obje_emb_subs
@@ -2769,9 +2873,10 @@ multim_obje_emb_sub : multim_obje_form_sect  { OCCUR2(FORM, 1, 1) }
                     ;
 
 multim_obje_form_sect : OPEN DELIM TAG_FORM mand_line_item    
-                        { $<ctxt>$ = start_element(ELT_SUB_MULTIM_OBJE_FORM,
-                                                  PARENT, $1, $3, $4,
-                                                  GEDCOM_MAKE_STRING($4));
+                        { $<ctxt>$
+                           = start_element(ELT_SUB_MULTIM_OBJE_FORM,
+                                           PARENT, $1, $3, $4,
+                                           GEDCOM_MAKE_STRING(val1, $4));
                          START(FORM, $<ctxt>$)     
                         }     
                         no_std_subs     
@@ -2782,9 +2887,10 @@ multim_obje_form_sect : OPEN DELIM TAG_FORM mand_line_item
                        }
                       ;
 multim_obje_titl_sect : OPEN DELIM TAG_TITL mand_line_item    
-                        { $<ctxt>$ = start_element(ELT_SUB_MULTIM_OBJE_TITL,
-                                                  PARENT, $1, $3, $4,
-                                                  GEDCOM_MAKE_STRING($4));
+                        { $<ctxt>$
+                           = start_element(ELT_SUB_MULTIM_OBJE_TITL,
+                                           PARENT, $1, $3, $4,
+                                           GEDCOM_MAKE_STRING(val1, $4));
                          START(TITL, $<ctxt>$)     
                         }     
                         no_std_subs     
@@ -2795,9 +2901,10 @@ multim_obje_titl_sect : OPEN DELIM TAG_TITL mand_line_item
                        }
                       ;
 multim_obje_file_sect : OPEN DELIM TAG_FILE mand_line_item    
-                        { $<ctxt>$ = start_element(ELT_SUB_MULTIM_OBJE_FILE,
-                                                  PARENT, $1, $3, $4,
-                                                  GEDCOM_MAKE_STRING($4));
+                        { $<ctxt>$
+                           = start_element(ELT_SUB_MULTIM_OBJE_FILE,
+                                           PARENT, $1, $3, $4,
+                                           GEDCOM_MAKE_STRING(val1, $4));
                          START(FILE, $<ctxt>$)     
                         }     
                         no_std_subs     
@@ -2814,9 +2921,14 @@ note_struc_sub : note_struc_link_sect  /* 0:M */
                ;
 
 note_struc_link_sect : OPEN DELIM TAG_NOTE DELIM POINTER
-                       { $<ctxt>$ = start_element(ELT_SUB_NOTE,
-                                                 PARENT, $1, $3, $5,
-                                                 GEDCOM_MAKE_STRING($5));
+                       { struct xref_value *xr = gedcom_parse_xref($5,
+                                                                  XREF_USED,
+                                                                  XREF_NOTE);
+                        if (xr == NULL) HANDLE_ERROR;
+                        $<ctxt>$
+                          = start_element(ELT_SUB_NOTE,
+                                          PARENT, $1, $3, $5,
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                         START(NOTE, $<ctxt>$) 
                        }
                        note_struc_link_subs
@@ -2838,7 +2950,7 @@ note_struc_emb_sect : OPEN DELIM TAG_NOTE opt_line_item
                       { $<ctxt>$
                          = start_element(ELT_SUB_NOTE,
                                          PARENT, $1, $3, $4,
-                                         GEDCOM_MAKE_NULL_OR_STRING($4));
+                                        GEDCOM_MAKE_NULL_OR_STRING(val1, $4));
                        START(NOTE, $<ctxt>$) 
                       }
                       note_struc_emb_subs
@@ -2864,7 +2976,7 @@ pers_name_struc_sub : pers_name_sect /* 0:M */
 pers_name_sect : OPEN DELIM TAG_NAME mand_line_item 
                  { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(NAME, $<ctxt>$)  
                  }
                  pers_name_subs
@@ -2892,7 +3004,7 @@ pers_name_sub  : pers_name_npfx_sect  { OCCUR2(NPFX, 0, 1) }
 pers_name_npfx_sect : OPEN DELIM TAG_NPFX mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_NPFX,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(NPFX, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2905,7 +3017,7 @@ pers_name_npfx_sect : OPEN DELIM TAG_NPFX mand_line_item
 pers_name_givn_sect : OPEN DELIM TAG_GIVN mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_GIVN,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(GIVN, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2918,7 +3030,7 @@ pers_name_givn_sect : OPEN DELIM TAG_GIVN mand_line_item
 pers_name_nick_sect : OPEN DELIM TAG_NICK mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_NICK,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(NICK, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2931,7 +3043,7 @@ pers_name_nick_sect : OPEN DELIM TAG_NICK mand_line_item
 pers_name_spfx_sect : OPEN DELIM TAG_SPFX mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_SPFX,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(SPFX, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2944,7 +3056,7 @@ pers_name_spfx_sect : OPEN DELIM TAG_SPFX mand_line_item
 pers_name_surn_sect : OPEN DELIM TAG_SURN mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_SURN,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(SURN, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2957,7 +3069,7 @@ pers_name_surn_sect : OPEN DELIM TAG_SURN mand_line_item
 pers_name_nsfx_sect : OPEN DELIM TAG_NSFX mand_line_item    
                       { $<ctxt>$ = start_element(ELT_SUB_PERS_NAME_NSFX,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(NSFX, $<ctxt>$)     
                       }     
                       no_std_subs     
@@ -2973,9 +3085,10 @@ place_struc_sub : place_struc_plac_sect /* 0:M */
                 ;
 
 place_struc_plac_sect : OPEN DELIM TAG_PLAC mand_line_item 
-                        { $<ctxt>$ = start_element(ELT_SUB_PLAC,
-                                                  PARENT, $1, $3, $4,
-                                                  GEDCOM_MAKE_STRING($4));
+                        { $<ctxt>$
+                           = start_element(ELT_SUB_PLAC,
+                                           PARENT, $1, $3, $4,
+                                           GEDCOM_MAKE_STRING(val1, $4));
                          START(PLAC, $<ctxt>$)  
                         }
                         place_struc_plac_subs
@@ -2996,9 +3109,10 @@ place_struc_plac_sub : place_plac_form_sect  { OCCUR2(FORM, 0, 1) }
                      ;
 
 place_plac_form_sect : OPEN DELIM TAG_FORM mand_line_item    
-                       { $<ctxt>$ = start_element(ELT_SUB_PLAC_FORM,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_PLAC_FORM,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(FORM, $<ctxt>$)     
                        }     
                        no_std_subs     
@@ -3015,9 +3129,14 @@ source_cit_sub : source_cit_link_sect /* 0:M */
                ;
 
 source_cit_link_sect : OPEN DELIM TAG_SOUR DELIM POINTER
-                       { $<ctxt>$ = start_element(ELT_SUB_SOUR,
-                                                 PARENT, $1, $3, $5,
-                                                 GEDCOM_MAKE_STRING($5));
+                       { struct xref_value *xr = gedcom_parse_xref($5,
+                                                                  XREF_USED,
+                                                                  XREF_SOUR);
+                        if (xr == NULL) HANDLE_ERROR;
+                        $<ctxt>$
+                          = start_element(ELT_SUB_SOUR,
+                                          PARENT, $1, $3, $5,
+                                          GEDCOM_MAKE_XREF_PTR(val1, xr));
                         START(SOUR, $<ctxt>$) 
                        }
                        source_cit_link_subs
@@ -3041,9 +3160,10 @@ source_cit_link_sub : source_cit_page_sect  { OCCUR2(PAGE, 0, 1) }
                     ;
 
 source_cit_page_sect : OPEN DELIM TAG_PAGE mand_line_item    
-                       { $<ctxt>$ = start_element(ELT_SUB_SOUR_PAGE,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_SOUR_PAGE,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(PAGE, $<ctxt>$)     
                        }     
                        no_std_subs     
@@ -3055,9 +3175,10 @@ source_cit_page_sect : OPEN DELIM TAG_PAGE mand_line_item
                      ;
 
 source_cit_even_sect : OPEN DELIM TAG_EVEN mand_line_item 
-                       { $<ctxt>$ = start_element(ELT_SUB_SOUR_EVEN,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_SOUR_EVEN,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(EVEN, $<ctxt>$)     
                        }
                        source_cit_even_subs
@@ -3077,9 +3198,10 @@ source_cit_even_sub  : source_cit_even_role_sect  { OCCUR2(ROLE, 0, 1) }
                      ;
 
 source_cit_even_role_sect : OPEN DELIM TAG_ROLE mand_line_item    
-                          { $<ctxt>$ = start_element(ELT_SUB_SOUR_EVEN_ROLE,
-                                                    PARENT, $1, $3, $4,
-                                                    GEDCOM_MAKE_STRING($4));
+                          { $<ctxt>$
+                             = start_element(ELT_SUB_SOUR_EVEN_ROLE,
+                                             PARENT, $1, $3, $4,
+                                             GEDCOM_MAKE_STRING(val1, $4));
                            START(ROLE, $<ctxt>$)     
                           }     
                           no_std_subs     
@@ -3093,7 +3215,7 @@ source_cit_even_role_sect : OPEN DELIM TAG_ROLE mand_line_item
 source_cit_data_sect : OPEN DELIM TAG_DATA
                        { $<ctxt>$ = start_element(ELT_SUB_SOUR_DATA,
                                                  PARENT, $1, $3, NULL,
-                                                 GEDCOM_MAKE_NULL());
+                                                 GEDCOM_MAKE_NULL(val1));
                         START(DATA, $<ctxt>$) 
                        }
                        source_cit_data_subs
@@ -3115,9 +3237,10 @@ source_cit_data_sub : source_cit_data_date_sect  { OCCUR2(DATE, 0, 1) }
 
 source_cit_data_date_sect : OPEN DELIM TAG_DATE mand_line_item    
                             { struct date_value dv = gedcom_parse_date($4);
-                             $<ctxt>$ = start_element(ELT_SUB_SOUR_DATA_DATE,
-                                                      PARENT, $1, $3, $4,
-                                                      GEDCOM_MAKE_DATE(dv));
+                             $<ctxt>$
+                               = start_element(ELT_SUB_SOUR_DATA_DATE,
+                                               PARENT, $1, $3, $4,
+                                               GEDCOM_MAKE_DATE(val1, dv));
                              START(DATE, $<ctxt>$)     
                             }     
                             no_std_subs     
@@ -3129,9 +3252,10 @@ source_cit_data_date_sect : OPEN DELIM TAG_DATE mand_line_item
                           ;
 
 source_cit_text_sect : OPEN DELIM TAG_TEXT mand_line_item 
-                       { $<ctxt>$ = start_element(ELT_SUB_SOUR_TEXT,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_SOUR_TEXT,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(TEXT, $<ctxt>$)  
                        }
                        source_cit_text_subs
@@ -3151,9 +3275,10 @@ source_cit_text_sub : continuation_sub
                     ;
 
 source_cit_quay_sect : OPEN DELIM TAG_QUAY mand_line_item    
-                       { $<ctxt>$ = start_element(ELT_SUB_SOUR_QUAY,
-                                                 PARENT, $1, $3, $4,
-                                                 GEDCOM_MAKE_STRING($4));
+                       { $<ctxt>$
+                          = start_element(ELT_SUB_SOUR_QUAY,
+                                          PARENT, $1, $3, $4,
+                                          GEDCOM_MAKE_STRING(val1, $4));
                         START(QUAY, $<ctxt>$)     
                        }     
                        no_std_subs     
@@ -3167,7 +3292,7 @@ source_cit_quay_sect : OPEN DELIM TAG_QUAY mand_line_item
 source_cit_emb_sect : OPEN DELIM TAG_SOUR mand_line_item
                       { $<ctxt>$ = start_element(ELT_SUB_SOUR,
                                                 PARENT, $1, $3, $4,
-                                                GEDCOM_MAKE_STRING($4));
+                                                GEDCOM_MAKE_STRING(val1, $4));
                        START(SOUR, $<ctxt>$) 
                       }
                       source_cit_emb_subs
@@ -3192,9 +3317,13 @@ source_repos_cit_sub : source_repos_repo_sect  { OCCUR2(REPO, 0, 1) }
                      ;
 
 source_repos_repo_sect : OPEN DELIM TAG_REPO mand_pointer
-                         { $<ctxt>$ = start_element(ELT_SUB_REPO,
-                                                   PARENT, $1, $3, $4,
-                                                   GEDCOM_MAKE_STRING($4));
+                         { struct xref_value *xr
+                            = gedcom_parse_xref($4, XREF_USED, XREF_REPO);
+                          if (xr == NULL) HANDLE_ERROR;
+                          $<ctxt>$
+                            = start_element(ELT_SUB_REPO,
+                                            PARENT, $1, $3, $4,
+                                            GEDCOM_MAKE_XREF_PTR(val1, xr));
                           START(REPO, $<ctxt>$) 
                          }
                          source_repos_repo_subs
@@ -3216,7 +3345,7 @@ source_repos_repo_sub  : note_struc_sub
 caln_sect : OPEN DELIM TAG_CALN mand_line_item 
             { $<ctxt>$ = start_element(ELT_SUB_REPO_CALN,
                                       PARENT, $1, $3, $4,
-                                      GEDCOM_MAKE_STRING($4));
+                                      GEDCOM_MAKE_STRING(val1, $4));
              START(CALN, $<ctxt>$) 
            }
             caln_subs
@@ -3237,7 +3366,7 @@ caln_sub  : caln_medi_sect  { OCCUR2(MEDI, 0, 1) }
 caln_medi_sect : OPEN DELIM TAG_MEDI mand_line_item    
                  { $<ctxt>$ = start_element(ELT_SUB_REPO_CALN_MEDI,
                                            PARENT, $1, $3, $4,
-                                           GEDCOM_MAKE_STRING($4));
+                                           GEDCOM_MAKE_STRING(val1, $4));
                   START(MEDI, $<ctxt>$)  
                 }   
                 no_std_subs   
@@ -3252,9 +3381,13 @@ spou_fam_link_sub : spou_fam_fams_sect  /* 0:M */
                   ;
 
 spou_fam_fams_sect : OPEN DELIM TAG_FAMS mand_pointer
-                     { $<ctxt>$ = start_element(ELT_SUB_FAMS,
-                                               PARENT, $1, $3, $4,
-                                               GEDCOM_MAKE_STRING($4));
+                     { struct xref_value *xr = gedcom_parse_xref($4, XREF_USED,
+                                                                XREF_FAM);
+                      if (xr == NULL) HANDLE_ERROR;
+                      $<ctxt>$
+                        = start_element(ELT_SUB_FAMS,
+                                        PARENT, $1, $3, $4,
+                                        GEDCOM_MAKE_XREF_PTR(val1, xr));
                       START(FAMS, $<ctxt>$) 
                      }
                      spou_fam_fams_subs
@@ -3298,9 +3431,15 @@ user_rec    : OPEN DELIM opt_xref USERTAG
                }
              }
               opt_value
-              { $<ctxt>$ = start_record(REC_USER,
-                                       $1, GEDCOM_MAKE_NULL_OR_STRING($3), $4,
-                                       $6, GEDCOM_MAKE_NULL_OR_STRING($6));
+              { struct xref_value *xr = NULL;
+               if ($3 != NULL) {
+                 xr = gedcom_parse_xref($3, XREF_DEFINED, XREF_USER);
+                 if (xr == NULL) HANDLE_ERROR;
+               }
+               $<ctxt>$ = start_record(REC_USER,
+                                       $1,
+                                       GEDCOM_MAKE_NULL_OR_XREF_PTR(val1, xr),
+                                       $4, $6, &val2);
                START($4, $<ctxt>$)
              }
              user_sects
@@ -3316,8 +3455,7 @@ user_sect   : OPEN DELIM opt_xref USERTAG
                }
              }
               opt_value
-              { $<ctxt>$ = start_element(ELT_USER, PARENT, $1, $4, $6,  
-                                        GEDCOM_MAKE_NULL_OR_STRING($6));
+              { $<ctxt>$ = start_element(ELT_USER, PARENT, $1, $4, $6, &val2);
                START($4, $<ctxt>$);
              }
              user_sects
@@ -3335,12 +3473,15 @@ opt_xref    : /* empty */        { $$ = NULL; }
             | POINTER DELIM        { $$ = $1; }
             ;
 
-opt_value   : /* empty */        { $$ = NULL; }
-            | DELIM line_value        { $$ = $2; }
-            ;
-
-line_value  : POINTER        { $$ = $1; }
-            | line_item        { $$ = $1; }
+opt_value   : /* empty */        { GEDCOM_MAKE_NULL(val2);
+                                   $$ = NULL; }
+            | DELIM POINTER      { struct xref_value *xr
+                                    = gedcom_parse_xref($2, XREF_USED,
+                                                        XREF_USER);
+                                  GEDCOM_MAKE_XREF_PTR(val2, xr);
+                                  $$ = $2; }
+            | DELIM line_item    { GEDCOM_MAKE_STRING(val2, $2);
+                                  $$ = $2; }
             ;
 
 mand_pointer : /* empty */ { gedcom_error(_("Missing pointer")); YYERROR; }
index 152599a2ec0fea2c63443b934335c0c3535fb314..74d2e9190931698c9a2a87742cd891a3b0d73591 100644 (file)
@@ -97,7 +97,8 @@ void end_element(Gedcom_elt elt, Gedcom_ctxt parent, Gedcom_ctxt self,
 
 char* val_type_str[] = { N_("null value"),
                         N_("character string"),
-                        N_("date") };
+                        N_("date"),
+                         N_("cross-reference") };
 
 void gedcom_cast_error(char* file, int line,
                       Gedcom_val_type tried_type,
index cff8608f049337a143c1dca78265807dfc7bcdad..18992760f5883a230d9e0c6671bf21903874b86e 100644 (file)
@@ -1,5 +1,5 @@
 /* The lexer multiplexer for Gedcom.
-   Copyright (C) 2001 The Genes Development Team
+   Copyright (C) 2001,2002 The Genes Development Team
    This file is part of the Gedcom parser library.
    Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
 
@@ -24,6 +24,7 @@
 #include "gedcom_internal.h"
 #include "multilex.h"
 #include "encoding.h"
+#include "xref.h"
 
 int line_no;
 
@@ -128,7 +129,10 @@ int gedcom_parse_file(char* file_name)
     
     if (lexer_init(enc, file)) {
       line_no = 1;
+      make_xref_table();
       result = gedcom_parse();
+      if (result == 0)
+       result = check_xref_table();
     }
     lexer_close();
     fclose(file);
diff --git a/gedcom/xref.c b/gedcom/xref.c
new file mode 100644 (file)
index 0000000..3c33909
--- /dev/null
@@ -0,0 +1,156 @@
+/* Cross-reference manipulation routines.
+   Copyright (C) 2001,2002 The Genes Development Team
+   This file is part of the Gedcom parser library.
+   Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
+
+   The Gedcom parser library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The Gedcom parser library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the Gedcom parser library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* $Id$ */
+/* $Name$ */
+
+#include "gedcom_internal.h"
+#include "xref.h"
+#include "hash.h"
+
+struct xref_value def_xref_val = { XREF_NONE, "<error>", NULL };
+static hash_t *xrefs = NULL;
+
+char* xref_type_str[] = { N_("nothing"),
+                          N_("a family"),
+                         N_("an individual"),
+                         N_("a note"),
+                         N_("a multimedia object"),
+                         N_("a source repository"),
+                         N_("a source"),
+                         N_("a submitter"),
+                         N_("a submission record"),
+                         N_("an application-specific record"),
+                        };
+
+struct xref_node {
+  struct xref_value xref;
+  Xref_type defined_type;
+  Xref_type used_type;
+  int defined_line;
+  int used_line;
+};
+
+hnode_t *xref_alloc(void *c __attribute__((unused)))
+{
+  return malloc(sizeof *xref_alloc(NULL));
+}
+
+void xref_free(hnode_t *n, void *c __attribute__((unused)))
+{
+  struct xref_node *xr = (struct xref_node *)hnode_get(n);
+  free((void*)hnode_getkey(n));
+  free(xr->xref.string);
+  free(xr);
+  free(n);
+}
+
+struct xref_node *make_xref_node()
+{
+  struct xref_node *xr = (struct xref_node *)malloc(sizeof(struct xref_node));
+  xr->xref.type    = XREF_NONE;
+  xr->xref.string  = NULL;
+  xr->xref.object  = NULL;
+  xr->defined_type = XREF_NONE;
+  xr->used_type    = XREF_NONE;
+  xr->defined_line = -1;
+  xr->used_line    = -1;
+  return xr;
+}
+
+void make_xref_table()
+{
+  xrefs = hash_create(HASHCOUNT_T_MAX, NULL, NULL);
+  hash_set_allocator(xrefs, xref_alloc, xref_free, NULL);
+}
+
+int check_xref_table()
+{
+  int result = 0;
+  hscan_t hs;
+  hnode_t *node;
+  struct xref_node *xr;
+
+  /* Check for undefined and unused xrefs */
+  hash_scan_begin(&hs, xrefs);
+  while ((node = hash_scan_next(&hs))) {
+    xr = (struct xref_node *)hnode_get(node);
+    if (xr->defined_type == XREF_NONE && xr->used_type != XREF_NONE) {
+      gedcom_error(_("Cross-reference %s used on line %d is not defined"),
+                  xr->xref.string, xr->used_line);
+      result |= 1;
+    }
+    if (xr->used_type == XREF_NONE && xr->defined_type != XREF_NONE) {
+      gedcom_warning(_("Cross-reference %s defined on line %d is never used"),
+                    xr->xref.string, xr->defined_line);
+    }
+  }
+  
+  hash_free(xrefs);
+  return result;
+}
+
+struct xref_value *gedcom_parse_xref(char *raw_value,
+                                    Xref_ctxt ctxt, Xref_type xref_type)
+{
+  struct xref_node *xr = NULL;
+  
+  hnode_t *node = hash_lookup(xrefs, raw_value);
+  if (node) {
+    xr = (struct xref_node *)hnode_get(node);
+  }
+  else {
+    char *key = strdup(raw_value);
+    xr = make_xref_node();
+    xr->xref.type = xref_type;
+    xr->xref.string = strdup(raw_value);
+    hash_alloc_insert(xrefs, key, xr);
+  }
+    
+  if (ctxt == XREF_DEFINED && xr->defined_type == XREF_NONE) {
+    xr->defined_type = xref_type;
+    xr->defined_line = line_no;
+  }
+  else if (ctxt == XREF_USED && xr->used_type == XREF_NONE) {
+    xr->used_type = xref_type;
+    xr->used_line = line_no;
+  }
+  
+  if ((ctxt == XREF_DEFINED && xr->defined_type != xref_type)
+      || (ctxt == XREF_USED &&
+         (xr->defined_type != XREF_NONE && xr->defined_type != xref_type))) {
+    gedcom_error(_("Cross-reference %s previously defined as pointer to %s, "
+                  "on line %d"),
+                xr->xref.string, xref_type_str[xr->defined_type],
+                xr->defined_line);
+    return NULL;
+  }
+  
+  if ((ctxt == XREF_USED && xr->used_type != xref_type)
+      || (ctxt == XREF_DEFINED &&
+         (xr->used_type != XREF_NONE && xr->used_type != xref_type))) {
+    gedcom_error(_("Cross-reference %s previously used as pointer to %s, "
+                  "on line %d"),
+                xr->xref.string, xref_type_str[xr->used_type], xr->used_line);
+    return NULL;
+  }
+  
+  return &(xr->xref);
+}
diff --git a/gedcom/xref.h b/gedcom/xref.h
new file mode 100644 (file)
index 0000000..a60a4ec
--- /dev/null
@@ -0,0 +1,48 @@
+/* Header for cross-reference manipulation routines.
+   Copyright (C) 2001,2002 The Genes Development Team
+   This file is part of the Gedcom parser library.
+   Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
+
+   The Gedcom parser library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The Gedcom parser library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the Gedcom parser library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* $Id$ */
+/* $Name$ */
+
+#ifndef __XREF_H
+#define __XREF_H
+
+#include "gedcom.h"
+
+typedef enum _XREF_CTXT {
+  XREF_DEFINED,
+  XREF_USED
+} Xref_ctxt;
+
+void make_xref_table();
+int check_xref_table();
+
+struct xref_value *gedcom_parse_xref(char *raw_value,
+                                    Xref_ctxt ctxt, Xref_type type);
+
+#define GEDCOM_MAKE_XREF_PTR(VAR, XREF) \
+   GEDCOM_MAKE(VAR, XREF, GV_XREF_PTR, xref_val)
+
+#define GEDCOM_MAKE_NULL_OR_XREF_PTR(VAR, XREF) \
+   (XREF == NULL ? \
+    GEDCOM_MAKE_NULL(VAR) : \
+    GEDCOM_MAKE_XREF_PTR(VAR, XREF))
+
+#endif /* __XREF_H */
index 495beb850be32f026c96c3cd58c1d5b5f703fe61..2b962dae797ec2e452c7f63bf87530452320611f 100644 (file)
@@ -313,6 +313,25 @@ struct date_value {
 /* Type for context handling, meant to be opaque */
 typedef void* Gedcom_ctxt;
 
+typedef enum _XREF_TYPE {
+  XREF_NONE,
+  XREF_FAM,
+  XREF_INDI,
+  XREF_NOTE,
+  XREF_OBJE,
+  XREF_REPO,
+  XREF_SOUR,
+  XREF_SUBM,
+  XREF_SUBN,
+  XREF_USER
+} Xref_type;
+
+struct xref_value {
+  Xref_type type;
+  char *string;
+  Gedcom_ctxt object;
+};
+
 /**************************************************************************/
 /***  Things meant to be internal, susceptible to changes               ***/
 /***  Use the GEDCOM_STRING/GEDCOM_DATE interface instead of relying    ***/
@@ -322,12 +341,14 @@ typedef void* Gedcom_ctxt;
 typedef enum _GEDCOM_VAL_TYPE {
   GV_NULL,
   GV_CHAR_PTR,
-  GV_DATE_VALUE
+  GV_DATE_VALUE,
+  GV_XREF_PTR
 } Gedcom_val_type;
 
 union _Gedcom_val_union {
   char* string_val;
   struct date_value date_val;
+  struct xref_value *xref_val;
 };
 
 typedef struct _Gedcom_val_struct {
@@ -340,6 +361,7 @@ void gedcom_cast_error(char* file, int line,
                       Gedcom_val_type real_type);
 
 extern struct date_value def_date_val;
+extern struct xref_value def_xref_val;
 
 #define GV_CHECK_CAST(VAL, TYPE, MEMBER, DEFVAL)                              \
    ((VAL->type == TYPE) ?                                                     \
@@ -374,6 +396,13 @@ typedef Gedcom_val_struct* Gedcom_val;
 #define GEDCOM_IS_DATE(VAL) \
    GV_IS_TYPE(VAL, GV_DATE_VALUE)
 
+/* This returns the (struct xref_value *) from a Gedcom_val, if appropriate */
+/* It gives a gedcom_warning if the cast is not correct                     */
+#define GEDCOM_XREF_PTR(VAL) \
+   GV_CHECK_CAST(VAL, GV_XREF_PTR, xref_val, &def_xref_val)
+#define GEDCOM_IS_XREF_PTR(VAL) \
+   GV_IS_TYPE(VAL, GV_XREF_PTR)
+
 typedef void
         (*Gedcom_msg_handler)
         (Gedcom_msg_type type, char *msg);
index f5d782b5236eb71547b9173f3f6e0d03dde3432f..70a3ac17f80a8bb1a0f60ef811a560a6cfa735e1 100644 (file)
@@ -79,8 +79,10 @@ Gedcom_ctxt family_start(int level, Gedcom_val xref, char *tag,
                         char *raw_value, int tag_value,
                         Gedcom_val parsed_value)
 {
-  output(1, "Family start, xref is %s\n", GEDCOM_STRING(xref));
-  strcpy(family_xreftags[family_nr], GEDCOM_STRING(xref));
+  struct xref_value *xr = GEDCOM_XREF_PTR(xref);
+  output(1, "Family start, xref is %s\n", xr->string);
+  strcpy(family_xreftags[family_nr], xr->string);
+  xr->object = (Gedcom_ctxt)family_nr;
   return (Gedcom_ctxt)(family_nr++);
 }
 
@@ -88,9 +90,9 @@ Gedcom_ctxt rec_start(int level, Gedcom_val xref, char *tag,
                      char *raw_value, int tag_value,
                      Gedcom_val parsed_value)
 {
-  char *xref_str = NULL;
+  charxref_str = NULL;
   if (! GEDCOM_IS_NULL(xref))
-    xref_str = GEDCOM_STRING(xref);
+    xref_str = GEDCOM_XREF_PTR(xref)->string;
   output(1, "Rec %s start, xref is %s\n", tag, xref_str);
   return (Gedcom_ctxt)tag_value;
 }
@@ -99,9 +101,9 @@ Gedcom_ctxt note_start(int level, Gedcom_val xref, char *tag,
                       char *raw_value, int tag_value,
                       Gedcom_val parsed_value)
 {
-  output(0, "== %d %s (%d) %s (xref is %s)\n",
+  output(1, "== %d %s (%d) %s (xref is %s)\n",
         level, tag, tag_value, GEDCOM_STRING(parsed_value),
-        GEDCOM_STRING(xref));
+        GEDCOM_XREF_PTR(xref)->string);
   return (Gedcom_ctxt)tag_value;
 }
 
@@ -114,7 +116,7 @@ Gedcom_ctxt submit_start(int level, Gedcom_val xref, char *tag,
                         char *raw_value, int tag_value,
                         Gedcom_val parsed_value)
 {
-  output(1, "Submitter, xref is %s\n", GEDCOM_STRING(xref));
+  output(1, "Submitter, xref is %s\n", GEDCOM_XREF_PTR(xref)->string);
   return (Gedcom_ctxt)10000;
 }