xref: /webtrees/app/Factories/ElementFactory.php (revision cdf1da3023b0fd4e4114a9320dc176640753ab84)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2021 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Factories;
21
22use Fisharebest\Webtrees\Contracts\ElementFactoryInterface;
23use Fisharebest\Webtrees\Contracts\ElementInterface;
24use Fisharebest\Webtrees\Elements\AddressCity;
25use Fisharebest\Webtrees\Elements\AddressCountry;
26use Fisharebest\Webtrees\Elements\AddressEmail;
27use Fisharebest\Webtrees\Elements\AddressFax;
28use Fisharebest\Webtrees\Elements\AddressLine;
29use Fisharebest\Webtrees\Elements\AddressLine1;
30use Fisharebest\Webtrees\Elements\AddressLine2;
31use Fisharebest\Webtrees\Elements\AddressLine3;
32use Fisharebest\Webtrees\Elements\AddressPostalCode;
33use Fisharebest\Webtrees\Elements\AddressState;
34use Fisharebest\Webtrees\Elements\AddressWebPage;
35use Fisharebest\Webtrees\Elements\AdoptedByWhichParent;
36use Fisharebest\Webtrees\Elements\Adoption;
37use Fisharebest\Webtrees\Elements\AdultChristening;
38use Fisharebest\Webtrees\Elements\AgeAtEvent;
39use Fisharebest\Webtrees\Elements\AncestralFileNumber;
40use Fisharebest\Webtrees\Elements\Annulment;
41use Fisharebest\Webtrees\Elements\ApprovedSystemId;
42use Fisharebest\Webtrees\Elements\AttributeDescriptor;
43use Fisharebest\Webtrees\Elements\AutomatedRecordId;
44use Fisharebest\Webtrees\Elements\Baptism;
45use Fisharebest\Webtrees\Elements\BasMitzvah;
46use Fisharebest\Webtrees\Elements\Birth;
47use Fisharebest\Webtrees\Elements\Blessing;
48use Fisharebest\Webtrees\Elements\Burial;
49use Fisharebest\Webtrees\Elements\CasteName;
50use Fisharebest\Webtrees\Elements\CauseOfEvent;
51use Fisharebest\Webtrees\Elements\Census;
52use Fisharebest\Webtrees\Elements\CertaintyAssessment;
53use Fisharebest\Webtrees\Elements\Change;
54use Fisharebest\Webtrees\Elements\ChangeDate;
55use Fisharebest\Webtrees\Elements\CharacterSet;
56use Fisharebest\Webtrees\Elements\ChildLinkageStatus;
57use Fisharebest\Webtrees\Elements\Christening;
58use Fisharebest\Webtrees\Elements\Confirmation;
59use Fisharebest\Webtrees\Elements\ContentDescription;
60use Fisharebest\Webtrees\Elements\CopyrightFile;
61use Fisharebest\Webtrees\Elements\CopyrightSourceData;
62use Fisharebest\Webtrees\Elements\CountOfChildren;
63use Fisharebest\Webtrees\Elements\CountOfMarriages;
64use Fisharebest\Webtrees\Elements\Cremation;
65use Fisharebest\Webtrees\Elements\CustomElement;
66use Fisharebest\Webtrees\Elements\CustomEvent;
67use Fisharebest\Webtrees\Elements\CustomFact;
68use Fisharebest\Webtrees\Elements\DateLdsOrd;
69use Fisharebest\Webtrees\Elements\DateValue;
70use Fisharebest\Webtrees\Elements\Death;
71use Fisharebest\Webtrees\Elements\DescriptiveTitle;
72use Fisharebest\Webtrees\Elements\Divorce;
73use Fisharebest\Webtrees\Elements\DivorceFiled;
74use Fisharebest\Webtrees\Elements\Emigration;
75use Fisharebest\Webtrees\Elements\EmptyElement;
76use Fisharebest\Webtrees\Elements\Engagement;
77use Fisharebest\Webtrees\Elements\EntryRecordingDate;
78use Fisharebest\Webtrees\Elements\EventAttributeType;
79use Fisharebest\Webtrees\Elements\EventDescriptor;
80use Fisharebest\Webtrees\Elements\EventOrFactClassification;
81use Fisharebest\Webtrees\Elements\EventsRecorded;
82use Fisharebest\Webtrees\Elements\EventTypeCitedFrom;
83use Fisharebest\Webtrees\Elements\FamilyRecord;
84use Fisharebest\Webtrees\Elements\FamilySearchFamilyTreeId;
85use Fisharebest\Webtrees\Elements\FamilyStatusText;
86use Fisharebest\Webtrees\Elements\FileName;
87use Fisharebest\Webtrees\Elements\FirstCommunion;
88use Fisharebest\Webtrees\Elements\Form;
89use Fisharebest\Webtrees\Elements\GedcomElement;
90use Fisharebest\Webtrees\Elements\GenerationsOfAncestors;
91use Fisharebest\Webtrees\Elements\GenerationsOfDescendants;
92use Fisharebest\Webtrees\Elements\GovIdentifier;
93use Fisharebest\Webtrees\Elements\Graduation;
94use Fisharebest\Webtrees\Elements\HeaderRecord;
95use Fisharebest\Webtrees\Elements\HierarchicalRelationship;
96use Fisharebest\Webtrees\Elements\Immigration;
97use Fisharebest\Webtrees\Elements\IndividualRecord;
98use Fisharebest\Webtrees\Elements\LanguageId;
99use Fisharebest\Webtrees\Elements\LdsBaptism;
100use Fisharebest\Webtrees\Elements\LdsBaptismDateStatus;
101use Fisharebest\Webtrees\Elements\LdsChildSealing;
102use Fisharebest\Webtrees\Elements\LdsChildSealingDateStatus;
103use Fisharebest\Webtrees\Elements\LdsConfirmation;
104use Fisharebest\Webtrees\Elements\LdsEndowment;
105use Fisharebest\Webtrees\Elements\LdsEndowmentDateStatus;
106use Fisharebest\Webtrees\Elements\LdsSpouseSealing;
107use Fisharebest\Webtrees\Elements\LdsSpouseSealingDateStatus;
108use Fisharebest\Webtrees\Elements\LocationRecord;
109use Fisharebest\Webtrees\Elements\MaidenheadLocator;
110use Fisharebest\Webtrees\Elements\Marriage;
111use Fisharebest\Webtrees\Elements\MarriageBanns;
112use Fisharebest\Webtrees\Elements\MarriageContract;
113use Fisharebest\Webtrees\Elements\MarriageLicence;
114use Fisharebest\Webtrees\Elements\MarriageSettlement;
115use Fisharebest\Webtrees\Elements\MarriageType;
116use Fisharebest\Webtrees\Elements\MediaRecord;
117use Fisharebest\Webtrees\Elements\MultimediaFileReference;
118use Fisharebest\Webtrees\Elements\MultimediaFormat;
119use Fisharebest\Webtrees\Elements\NameOfBusiness;
120use Fisharebest\Webtrees\Elements\NameOfFamilyFile;
121use Fisharebest\Webtrees\Elements\NameOfProduct;
122use Fisharebest\Webtrees\Elements\NameOfRepository;
123use Fisharebest\Webtrees\Elements\NameOfSourceData;
124use Fisharebest\Webtrees\Elements\NamePersonal;
125use Fisharebest\Webtrees\Elements\NamePhoneticVariation;
126use Fisharebest\Webtrees\Elements\NamePieceGiven;
127use Fisharebest\Webtrees\Elements\NamePieceNickname;
128use Fisharebest\Webtrees\Elements\NamePiecePrefix;
129use Fisharebest\Webtrees\Elements\NamePieceSuffix;
130use Fisharebest\Webtrees\Elements\NamePieceSurname;
131use Fisharebest\Webtrees\Elements\NamePieceSurnamePrefix;
132use Fisharebest\Webtrees\Elements\NameRomanizedVariation;
133use Fisharebest\Webtrees\Elements\NameType;
134use Fisharebest\Webtrees\Elements\NationalIdNumber;
135use Fisharebest\Webtrees\Elements\NationOrTribalOrigin;
136use Fisharebest\Webtrees\Elements\Naturalization;
137use Fisharebest\Webtrees\Elements\NobilityTypeTitle;
138use Fisharebest\Webtrees\Elements\NoteRecord;
139use Fisharebest\Webtrees\Elements\NoteStructure;
140use Fisharebest\Webtrees\Elements\Occupation;
141use Fisharebest\Webtrees\Elements\OrdinanceProcessFlag;
142use Fisharebest\Webtrees\Elements\Ordination;
143use Fisharebest\Webtrees\Elements\PafUid;
144use Fisharebest\Webtrees\Elements\PedigreeLinkageType;
145use Fisharebest\Webtrees\Elements\PermanentRecordFileNumber;
146use Fisharebest\Webtrees\Elements\PhoneNumber;
147use Fisharebest\Webtrees\Elements\PhoneticType;
148use Fisharebest\Webtrees\Elements\PhysicalDescription;
149use Fisharebest\Webtrees\Elements\PlaceHierarchy;
150use Fisharebest\Webtrees\Elements\PlaceLatitude;
151use Fisharebest\Webtrees\Elements\PlaceLivingOrdinance;
152use Fisharebest\Webtrees\Elements\PlaceLongtitude;
153use Fisharebest\Webtrees\Elements\PlaceName;
154use Fisharebest\Webtrees\Elements\PlacePhoneticVariation;
155use Fisharebest\Webtrees\Elements\PlaceRomanizedVariation;
156use Fisharebest\Webtrees\Elements\Possessions;
157use Fisharebest\Webtrees\Elements\Probate;
158use Fisharebest\Webtrees\Elements\PublicationDate;
159use Fisharebest\Webtrees\Elements\ReceivingSystemName;
160use Fisharebest\Webtrees\Elements\RelationIsDescriptor;
161use Fisharebest\Webtrees\Elements\ReligiousAffiliation;
162use Fisharebest\Webtrees\Elements\RepositoryRecord;
163use Fisharebest\Webtrees\Elements\ResearchTask;
164use Fisharebest\Webtrees\Elements\ResearchTaskPriority;
165use Fisharebest\Webtrees\Elements\ResearchTaskStatus;
166use Fisharebest\Webtrees\Elements\ResearchTaskType;
167use Fisharebest\Webtrees\Elements\Residence;
168use Fisharebest\Webtrees\Elements\ResponsibleAgency;
169use Fisharebest\Webtrees\Elements\RestrictionNotice;
170use Fisharebest\Webtrees\Elements\Retirement;
171use Fisharebest\Webtrees\Elements\RoleInEvent;
172use Fisharebest\Webtrees\Elements\RomanizedType;
173use Fisharebest\Webtrees\Elements\ScholasticAchievement;
174use Fisharebest\Webtrees\Elements\SexValue;
175use Fisharebest\Webtrees\Elements\SexXValue;
176use Fisharebest\Webtrees\Elements\SocialSecurityNumber;
177use Fisharebest\Webtrees\Elements\SourceCallNumber;
178use Fisharebest\Webtrees\Elements\SourceData;
179use Fisharebest\Webtrees\Elements\SourceFiledByEntry;
180use Fisharebest\Webtrees\Elements\SourceJurisdictionPlace;
181use Fisharebest\Webtrees\Elements\SourceMediaType;
182use Fisharebest\Webtrees\Elements\SourceOriginator;
183use Fisharebest\Webtrees\Elements\SourcePublicationFacts;
184use Fisharebest\Webtrees\Elements\SourceRecord;
185use Fisharebest\Webtrees\Elements\SubmissionRecord;
186use Fisharebest\Webtrees\Elements\SubmitterName;
187use Fisharebest\Webtrees\Elements\SubmitterRecord;
188use Fisharebest\Webtrees\Elements\SubmitterRegisteredRfn;
189use Fisharebest\Webtrees\Elements\SubmitterText;
190use Fisharebest\Webtrees\Elements\TempleCode;
191use Fisharebest\Webtrees\Elements\TextFromSource;
192use Fisharebest\Webtrees\Elements\TimeValue;
193use Fisharebest\Webtrees\Elements\TransmissionDate;
194use Fisharebest\Webtrees\Elements\UnknownElement;
195use Fisharebest\Webtrees\Elements\UserReferenceNumber;
196use Fisharebest\Webtrees\Elements\UserReferenceType;
197use Fisharebest\Webtrees\Elements\VersionNumber;
198use Fisharebest\Webtrees\Elements\WebtreesUser;
199use Fisharebest\Webtrees\Elements\WhereWithinSource;
200use Fisharebest\Webtrees\Elements\Will;
201use Fisharebest\Webtrees\Elements\XrefFamily;
202use Fisharebest\Webtrees\Elements\XrefIndividual;
203use Fisharebest\Webtrees\Elements\XrefLocation;
204use Fisharebest\Webtrees\Elements\XrefMedia;
205use Fisharebest\Webtrees\Elements\XrefRepository;
206use Fisharebest\Webtrees\Elements\XrefSource;
207use Fisharebest\Webtrees\Elements\XrefSubmission;
208use Fisharebest\Webtrees\Elements\XrefSubmitter;
209use Fisharebest\Webtrees\I18N;
210
211use function preg_match;
212use function strpos;
213
214/**
215 * Make a GEDCOM element.
216 */
217class ElementFactory implements ElementFactoryInterface
218{
219    /** @var array<string,ElementInterface> */
220    private $elements = [];
221
222    /**
223     * Create a GEDCOM element that corresponds to a GEDCOM tag.
224     * Finds the correct element for all valid tags.
225     * Finds a likely element for custom tags.
226     *
227     * @param string $tag - Colon delimited hierarchy, e.g. 'INDI:BIRT:PLAC'
228     *
229     * @return ElementInterface
230     */
231    public function make(string $tag): ElementInterface
232    {
233        return $this->elements()[$tag] ?? $this->findElementByWildcard($tag) ?? new UnknownElement($tag);
234    }
235
236    /**
237     * Association between GEDCOM tags and GEDCOM elements.
238     * We can't initialise this in the constructor, as the I18N package isn't available then.
239     *
240     * @return array<string,ElementInterface>
241     */
242    private function elements(): array
243    {
244        if ($this->elements === []) {
245            // Gedcom 5.5.1
246            $this->elements = [
247                'FAM'                      => new FamilyRecord(I18N::translate('Family')),
248                'FAM:*:ADDR'               => new AddressLine(I18N::translate('Address')),
249                'FAM:*:ADDR:ADR1'          => new AddressLine1(I18N::translate('Address line 1')),
250                'FAM:*:ADDR:ADR2'          => new AddressLine2(I18N::translate('Address line 2')),
251                'FAM:*:ADDR:ADR3'          => new AddressLine3(I18N::translate('Address line 3')),
252                'FAM:*:ADDR:CITY'          => new AddressCity(I18N::translate('City')),
253                'FAM:*:ADDR:CTRY'          => new AddressCountry(I18N::translate('Country')),
254                'FAM:*:ADDR:POST'          => new AddressPostalCode(I18N::translate('Postal code')),
255                'FAM:*:ADDR:STAE'          => new AddressState(I18N::translate('State')),
256                'FAM:*:AGNC'               => new ResponsibleAgency(I18N::translate('Agency')),
257                'FAM:*:CAUS'               => new CauseOfEvent(I18N::translate('Cause')),
258                'FAM:*:DATE'               => new DateValue(I18N::translate('Date')),
259                'FAM:*:EMAIL'              => new AddressEmail(I18N::translate('Email address')),
260                'FAM:*:FAX'                => new AddressFax(I18N::translate('Fax')),
261                'FAM:*:HUSB'               => new EmptyElement(I18N::translate('Husband'), ['AGE' => '0:1']),
262                'FAM:*:HUSB:AGE'           => new AgeAtEvent(I18N::translate('Husband’s age')),
263                'FAM:*:NOTE'               => new NoteStructure(I18N::translate('Note')),
264                'FAM:*:OBJE'               => new XrefMedia(I18N::translate('Media object')),
265                'FAM:*:PHON'               => new PhoneNumber(I18N::translate('Phone')),
266                'FAM:*:PLAC'               => new PlaceName(I18N::translate('Place')),
267                'FAM:*:PLAC:FONE'          => new PlacePhoneticVariation(I18N::translate('Phonetic place')),
268                'FAM:*:PLAC:FONE:TYPE'     => new PhoneticType(I18N::translate('Type')),
269                'FAM:*:PLAC:FORM'          => new PlaceHierarchy(I18N::translate('Format')),
270                'FAM:*:PLAC:MAP'           => new EmptyElement(I18N::translate('Coordinates')),
271                'FAM:*:PLAC:MAP:LATI'      => new PlaceLatitude(I18N::translate('Latitude')),
272                'FAM:*:PLAC:MAP:LONG'      => new PlaceLongtitude(I18N::translate('Longitude')),
273                'FAM:*:PLAC:NOTE'          => new NoteStructure(I18N::translate('Note')),
274                'FAM:*:PLAC:ROMN'          => new PlaceRomanizedVariation(I18N::translate('Romanized place')),
275                'FAM:*:PLAC:ROMN:TYPE'     => new RomanizedType(I18N::translate('Type')),
276                'FAM:*:RELI'               => new ReligiousAffiliation(I18N::translate('Religion')),
277                'FAM:*:RESN'               => new RestrictionNotice(I18N::translate('Restriction')),
278                'FAM:*:SOUR'               => new XrefSource(I18N::translate('Source')),
279                'FAM:*:SOUR:DATA'          => new SourceData(I18N::translate('Data')),
280                'FAM:*:SOUR:DATA:DATE'     => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
281                'FAM:*:SOUR:DATA:TEXT'     => new TextFromSource(I18N::translate('Text')),
282                'FAM:*:SOUR:EVEN'          => new EventTypeCitedFrom(I18N::translate('Event')),
283                'FAM:*:SOUR:EVEN:ROLE'     => new RoleInEvent(I18N::translate('Role')),
284                'FAM:*:SOUR:NOTE'          => new NoteStructure(I18N::translate('Note')),
285                'FAM:*:SOUR:OBJE'          => new XrefMedia(I18N::translate('Media object')),
286                'FAM:*:SOUR:PAGE'          => new WhereWithinSource(I18N::translate('Citation details')),
287                'FAM:*:SOUR:QUAY'          => new CertaintyAssessment(I18N::translate('Quality of data')),
288                'FAM:*:TYPE'               => new EventOrFactClassification(I18N::translate('Type')),
289                'FAM:*:WIFE'               => new EmptyElement(I18N::translate('Wife'), ['AGE' => '0:1']),
290                'FAM:*:WIFE:AGE'           => new AgeAtEvent(I18N::translate('Wife’s age')),
291                'FAM:*:WWW'                => new AddressWebPage(I18N::translate('URL')),
292                'FAM:ANUL'                 => new Annulment(I18N::translate('Annulment')),
293                'FAM:CENS'                 => new Census(I18N::translate('Census')),
294                'FAM:CHAN'                 => new Change(I18N::translate('Last change')),
295                'FAM:CHAN:DATE'            => new ChangeDate(I18N::translate('Date of last change')),
296                'FAM:CHAN:DATE:TIME'       => new TimeValue(I18N::translate('Time')),
297                'FAM:CHAN:NOTE'            => new NoteStructure(I18N::translate('Note')),
298                'FAM:CHIL'                 => new XrefIndividual(I18N::translate('Child')),
299                'FAM:DIV'                  => new Divorce(I18N::translate('Divorce')),
300                'FAM:DIVF'                 => new DivorceFiled(I18N::translate('Divorce filed')),
301                'FAM:ENGA'                 => new Engagement(I18N::translate('Engagement')),
302                'FAM:ENGA:DATE'            => new DateValue(I18N::translate('Date of engagement')),
303                'FAM:ENGA:PLACE'           => new PlaceName(I18N::translate('Place of engagement')),
304                'FAM:EVEN'                 => new EventDescriptor(I18N::translate('Event')),
305                'FAM:EVEN:TYPE'            => new EventAttributeType(I18N::translate('Type of event')),
306                'FAM:HUSB'                 => new XrefIndividual(I18N::translate('Husband')),
307                'FAM:MARB'                 => new MarriageBanns(I18N::translate('Marriage banns')),
308                'FAM:MARB:DATE'            => new DateValue(I18N::translate('Date of marriage banns')),
309                'FAM:MARB:PLAC'            => new PlaceName(I18N::translate('Place of marriage banns')),
310                'FAM:MARC'                 => new MarriageContract(I18N::translate('Marriage contract')),
311                'FAM:MARL'                 => new MarriageLicence(I18N::translate('Marriage license')),
312                'FAM:MARR'                 => new Marriage(I18N::translate('Marriage')),
313                'FAM:MARR:DATE'            => new DateValue(I18N::translate('Date of marriage')),
314                'FAM:MARR:PLAC'            => new PlaceName(I18N::translate('Place of marriage')),
315                'FAM:MARR:TYPE'            => new MarriageType(I18N::translate('Type of marriage')),
316                'FAM:MARS'                 => new MarriageSettlement(I18N::translate('Marriage settlement')),
317                'FAM:NCHI'                 => new CountOfChildren(I18N::translate('Number of children')),
318                'FAM:NOTE'                 => new NoteStructure(I18N::translate('Note')),
319                'FAM:OBJE'                 => new XrefMedia(I18N::translate('Media object')),
320                'FAM:REFN'                 => new UserReferenceNumber(I18N::translate('Reference number')),
321                'FAM:REFN:TYPE'            => new UserReferenceType(I18N::translate('Type')),
322                'FAM:RESI'                 => new Residence(I18N::translate('Residence')),
323                'FAM:RESN'                 => new RestrictionNotice(I18N::translate('Restriction')),
324                'FAM:RIN'                  => new AutomatedRecordId(I18N::translate('Record ID number')),
325                'FAM:SLGS'                 => new LdsSpouseSealing(I18N::translate('LDS spouse sealing')),
326                'FAM:SLGS:DATE'            => new DateLdsOrd(I18N::translate('Date')),
327                'FAM:SLGS:NOTE'            => new NoteStructure(I18N::translate('Note')),
328                'FAM:SLGS:PLAC'            => new PlaceLivingOrdinance(I18N::translate('Place')),
329                'FAM:SLGS:STAT'            => new LdsSpouseSealingDateStatus(I18N::translate('Status')),
330                'FAM:SLGS:STAT:DATE'       => new ChangeDate(I18N::translate('Status change date')),
331                'FAM:SLGS:TEMP'            => new TempleCode(I18N::translate('Temple')),
332                'FAM:SOUR'                 => new XrefSource(I18N::translate('Source')),
333                'FAM:SOUR:DATA'            => new SourceData(I18N::translate('Data')),
334                'FAM:SOUR:DATA:DATE'       => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
335                'FAM:SOUR:DATA:TEXT'       => new TextFromSource(I18N::translate('Text')),
336                'FAM:SOUR:EVEN'            => new EventTypeCitedFrom(I18N::translate('Event')),
337                'FAM:SOUR:EVEN:ROLE'       => new RoleInEvent(I18N::translate('Role')),
338                'FAM:SOUR:NOTE'            => new NoteStructure(I18N::translate('Note')),
339                'FAM:SOUR:OBJE'            => new XrefMedia(I18N::translate('Media object')),
340                'FAM:SOUR:PAGE'            => new WhereWithinSource(I18N::translate('Citation details')),
341                'FAM:SOUR:QUAY'            => new CertaintyAssessment(I18N::translate('Quality of data')),
342                'FAM:SUBM'                 => new XrefSubmitter(I18N::translate('Submitter')),
343                'FAM:WIFE'                 => new XrefIndividual(I18N::translate('Wife')),
344                'HEAD'                     => new HeaderRecord(I18N::translate('Header')),
345                'HEAD:CHAR'                => new CharacterSet(I18N::translate('Character set')),
346                'HEAD:CHAR:VERS'           => new VersionNumber(I18N::translate('Version')),
347                'HEAD:COPR'                => new CopyrightFile(I18N::translate('Copyright')),
348                'HEAD:DATE'                => new TransmissionDate(I18N::translate('Date')),
349                'HEAD:DATE:TIME'           => new TimeValue(I18N::translate('Time')),
350                'HEAD:DEST'                => new ReceivingSystemName(I18N::translate('Destination')),
351                'HEAD:FILE'                => new FileName(I18N::translate('Filename')),
352                'HEAD:GEDC'                => new GedcomElement(I18N::translate('GEDCOM')),
353                'HEAD:GEDC:FORM'           => new Form(I18N::translate('Format')),
354                'HEAD:GEDC:VERS'           => new VersionNumber(I18N::translate('Version')),
355                'HEAD:LANG'                => new LanguageId(I18N::translate('Language')),
356                'HEAD:NOTE'                => new ContentDescription(I18N::translate('Note')),
357                'HEAD:PLAC'                => new EmptyElement(I18N::translate('Place hierarchy'), ['FORM' => '1:1']),
358                'HEAD:PLAC:FORM'           => new PlaceHierarchy(I18N::translate('Format')),
359                'HEAD:SOUR'                => new ApprovedSystemId('Genealogy software'),
360                'HEAD:SOUR:CORP'           => new NameOfBusiness(I18N::translate('Corporation')),
361                'HEAD:SOUR:CORP:ADDR'      => new AddressLine(I18N::translate('Address')),
362                'HEAD:SOUR:CORP:ADDR:ADR1' => new AddressLine1(I18N::translate('Address line 1')),
363                'HEAD:SOUR:CORP:ADDR:ADR2' => new AddressLine2(I18N::translate('Address line 2')),
364                'HEAD:SOUR:CORP:ADDR:ADR3' => new AddressLine3(I18N::translate('Address line 3')),
365                'HEAD:SOUR:CORP:ADDR:CITY' => new AddressCity(I18N::translate('City')),
366                'HEAD:SOUR:CORP:ADDR:CTRY' => new AddressCountry(I18N::translate('Country')),
367                'HEAD:SOUR:CORP:ADDR:POST' => new AddressPostalCode(I18N::translate('Postal code')),
368                'HEAD:SOUR:CORP:ADDR:STAE' => new AddressState(I18N::translate('State')),
369                'HEAD:SOUR:CORP:EMAIL'     => new AddressEmail(I18N::translate('Email address')),
370                'HEAD:SOUR:CORP:FAX'       => new AddressFax(I18N::translate('Fax')),
371                'HEAD:SOUR:CORP:PHON'      => new PhoneNumber(I18N::translate('Phone')),
372                'HEAD:SOUR:CORP:WWW'       => new AddressWebPage(I18N::translate('URL')),
373                'HEAD:SOUR:DATA'           => new NameOfSourceData('Data'),
374                'HEAD:SOUR:DATA:COPR'      => new CopyrightSourceData(I18N::translate('Copyright')),
375                'HEAD:SOUR:DATA:DATE'      => new PublicationDate(I18N::translate('Date')),
376                'HEAD:SOUR:NAME'           => new NameOfProduct('Software product'),
377                'HEAD:SOUR:VERS'           => new VersionNumber(I18N::translate('Version')),
378                'HEAD:SUBM'                => new XrefSubmitter(I18N::translate('Submitter')),
379                'HEAD:SUBN'                => new XrefSubmission(I18N::translate('Submission')),
380                'INDI'                     => new IndividualRecord(I18N::translate('Individual')),
381                'INDI:*:ADDR'              => new AddressLine(I18N::translate('Address')),
382                'INDI:*:ADDR:ADR1'         => new AddressLine1(I18N::translate('Address line 1')),
383                'INDI:*:ADDR:ADR2'         => new AddressLine2(I18N::translate('Address line 2')),
384                'INDI:*:ADDR:ADR3'         => new AddressLine3(I18N::translate('Address line 3')),
385                'INDI:*:ADDR:CITY'         => new AddressCity(I18N::translate('City')),
386                'INDI:*:ADDR:CTRY'         => new AddressCountry(I18N::translate('Country')),
387                'INDI:*:ADDR:POST'         => new AddressPostalCode(I18N::translate('Postal code')),
388                'INDI:*:ADDR:STAE'         => new AddressState(I18N::translate('State')),
389                'INDI:*:AGE'               => new AgeAtEvent(I18N::translate('Age')),
390                'INDI:*:AGNC'              => new ResponsibleAgency(I18N::translate('Agency')),
391                'INDI:*:CAUS'              => new CauseOfEvent(I18N::translate('Cause')),
392                'INDI:*:DATE'              => new DateValue(I18N::translate('Date')),
393                'INDI:*:EMAIL'             => new AddressEmail(I18N::translate('Email address')),
394                'INDI:*:FAX'               => new AddressFax(I18N::translate('Fax')),
395                'INDI:*:NOTE'              => new NoteStructure(I18N::translate('Note')),
396                'INDI:*:OBJE'              => new XrefMedia(I18N::translate('Media object')),
397                'INDI:*:PHON'              => new PhoneNumber(I18N::translate('Phone')),
398                'INDI:*:PLAC'              => new PlaceName(I18N::translate('Place')),
399                'INDI:*:PLAC:FONE'         => new PlacePhoneticVariation(I18N::translate('Phonetic place')),
400                'INDI:*:PLAC:FONE:TYPE'    => new PhoneticType(I18N::translate('Type')),
401                'INDI:*:PLAC:FORM'         => new PlaceHierarchy(I18N::translate('Format')),
402                'INDI:*:PLAC:MAP'          => new EmptyElement(I18N::translate('Coordinates')),
403                'INDI:*:PLAC:MAP:LATI'     => new PlaceLatitude(I18N::translate('Latitude')),
404                'INDI:*:PLAC:MAP:LONG'     => new PlaceLongtitude(I18N::translate('Longitude')),
405                'INDI:*:PLAC:NOTE'         => new NoteStructure(I18N::translate('Note')),
406                'INDI:*:PLAC:ROMN'         => new PlaceRomanizedVariation(I18N::translate('Romanized place')),
407                'INDI:*:PLAC:ROMN:TYPE'    => new RomanizedType(I18N::translate('Type')),
408                'INDI:*:RELI'              => new ReligiousAffiliation(I18N::translate('Religion')),
409                'INDI:*:RESN'              => new RestrictionNotice(I18N::translate('Restriction')),
410                'INDI:*:SOUR'              => new XrefSource(I18N::translate('Source')),
411                'INDI:*:SOUR:DATA'         => new SourceData(I18N::translate('Data')),
412                'INDI:*:SOUR:DATA:DATE'    => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
413                'INDI:*:SOUR:DATA:TEXT'    => new TextFromSource(I18N::translate('Text')),
414                'INDI:*:SOUR:EVEN'         => new EventTypeCitedFrom(I18N::translate('Event')),
415                'INDI:*:SOUR:EVEN:ROLE'    => new RoleInEvent(I18N::translate('Role')),
416                'INDI:*:SOUR:NOTE'         => new NoteStructure(I18N::translate('Note')),
417                'INDI:*:SOUR:OBJE'         => new XrefMedia(I18N::translate('Media object')),
418                'INDI:*:SOUR:PAGE'         => new WhereWithinSource(I18N::translate('Citation details')),
419                'INDI:*:SOUR:QUAY'         => new CertaintyAssessment(I18N::translate('Quality of data')),
420                'INDI:*:TYPE'              => new EventOrFactClassification(I18N::translate('Type')),
421                'INDI:*:WWW'               => new AddressWebPage(I18N::translate('URL')),
422                'INDI:ADOP'                => new Adoption(I18N::translate('Adoption')),
423                'INDI:ADOP:DATE'           => new DateValue(I18N::translate('Date of adoption')),
424                'INDI:ADOP:FAMC'           => new XrefFamily(I18N::translate('Adoptive parents')),
425                'INDI:ADOP:FAMC:ADOP'      => new AdoptedByWhichParent(I18N::translate('Adoption')),
426                'INDI:ADOP:PLAC'           => new PlaceName(I18N::translate('Place of adoption')),
427                'INDI:AFN'                 => new AncestralFileNumber(I18N::translate('Ancestral file number')),
428                'INDI:ALIA'                => new XrefIndividual(I18N::translate('Alias')),
429                'INDI:ANCI'                => new XrefSubmitter(I18N::translate('Ancestors interest')),
430                'INDI:ASSO'                => new XrefIndividual(I18N::translate('Associate'), ['RELA' => '0:1', 'NOTE' => '0:M', 'SOUR' > '0:M']),
431                'INDI:ASSO:NOTE'           => new NoteStructure(I18N::translate('Note')),
432                'INDI:ASSO:RELA'           => new RelationIsDescriptor(I18N::translate('Relationship')),
433                'INDI:ASSO:SOUR'           => new XrefSource(I18N::translate('Source citation')),
434                'INDI:BAPL'                => new LdsBaptism(I18N::translate('LDS baptism')),
435                'INDI:BAPL:DATE'           => new DateLdsOrd(I18N::translate('Date of LDS baptism')),
436                'INDI:BAPL:NOTE'           => new NoteStructure(I18N::translate('Note')),
437                'INDI:BAPL:PLAC'           => new PlaceLivingOrdinance(I18N::translate('Place of LDS baptism')),
438                'INDI:BAPL:STAT'           => new LdsBaptismDateStatus(I18N::translate('Status')),
439                'INDI:BAPL:STAT:DATE'      => new ChangeDate(I18N::translate('Status change date')),
440                'INDI:BAPL:TEMP'           => new TempleCode(I18N::translate('Temple')),
441                'INDI:BAPM'                => new Baptism(I18N::translate('Baptism')),
442                'INDI:BAPM:DATE'           => new DateValue(I18N::translate('Date of baptism')),
443                'INDI:BAPM:PLAC'           => new PlaceName(I18N::translate('Place of baptism')),
444                'INDI:BARM'                => new PlaceName(I18N::translate('Bar mitzvah')),
445                'INDI:BARM:DATE'           => new DateValue(I18N::translate('Date of bar mitzvah')),
446                'INDI:BARM:PLAC'           => new PlaceName(I18N::translate('Place of bar mitzvah')),
447                'INDI:BASM'                => new BasMitzvah(I18N::translate('Bat mitzvah')),
448                'INDI:BASM:DATE'           => new BasMitzvah(I18N::translate('Date of bat mitzvah')),
449                'INDI:BASM:PLAC'           => new DateValue(I18N::translate('Place of bat mitzvah')),
450                'INDI:BIRT'                => new Birth(I18N::translate('Birth')),
451                'INDI:BIRT:DATE'           => new DateValue(I18N::translate('Date of birth')),
452                'INDI:BIRT:FAMC'           => new XrefFamily(I18N::translate('Birth parents')),
453                'INDI:BIRT:PLAC'           => new PlaceName(I18N::translate('Place of birth')),
454                'INDI:BLES'                => new Blessing(I18N::translate('Blessing')),
455                'INDI:BLES:DATE'           => new DateValue(I18N::translate('Date of blessing')),
456                'INDI:BLES:PLAC'           => new PlaceName(I18N::translate('Place of blessing')),
457                'INDI:BURI'                => new Burial(I18N::translate('Burial')),
458                'INDI:BURI:DATE'           => new DateValue(I18N::translate('Date of burial')),
459                'INDI:BURI:PLAC'           => new PlaceName(I18N::translate('Place of burial')),
460                'INDI:CAST'                => new CasteName(I18N::translate('Caste')),
461                'INDI:CENS'                => new Census(I18N::translate('Census')),
462                'INDI:CENS:DATE'           => new DateValue(I18N::translate('Census date')),
463                'INDI:CENS:PLAC'           => new PlaceName(I18N::translate('Census place')),
464                'INDI:CHAN'                => new Change(I18N::translate('Last change')),
465                'INDI:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
466                'INDI:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
467                'INDI:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
468                'INDI:CHR'                 => new Christening(I18N::translate('Christening')),
469                'INDI:CHR:DATE'            => new DateValue(I18N::translate('Date of christening')),
470                'INDI:CHR:FAMC'            => new XrefFamily(I18N::translate('Godparents')),
471                'INDI:CHR:PLAC'            => new PlaceName(I18N::translate('Place of christening')),
472                'INDI:CHRA'                => new AdultChristening(I18N::translate('Adult christening')),
473                'INDI:CONF'                => new Confirmation(I18N::translate('Confirmation')),
474                'INDI:CONF:DATE'           => new DateValue(I18N::translate('Date of confirmation')),
475                'INDI:CONF:PLAC'           => new PlaceName(I18N::translate('Place of confirmation')),
476                'INDI:CONL'                => new LdsConfirmation(I18N::translate('LDS confirmation')),
477                'INDI:CONL:DATE'           => new DateLdsOrd(I18N::translate('Date of LDS confirmation')),
478                'INDI:CONL:NOTE'           => new NoteStructure(I18N::translate('Note')),
479                'INDI:CONL:PLAC'           => new PlaceLivingOrdinance(I18N::translate('Place of LDS confirmation')),
480                'INDI:CONL:STAT'           => new LdsSpouseSealingDateStatus(I18N::translate('Status')),
481                'INDI:CONL:STAT:DATE'      => new ChangeDate(I18N::translate('Status change date')),
482                'INDI:CONL:TEMP'           => new TempleCode(I18N::translate('Temple')),
483                'INDI:CREM'                => new Cremation(I18N::translate('Cremation')),
484                'INDI:CREM:DATE'           => new Cremation(I18N::translate('Date of cremation')),
485                'INDI:CREM:PLAC'           => new Cremation(I18N::translate('Place of cremation')),
486                'INDI:DEAT'                => new Death(I18N::translate('Death')),
487                'INDI:DEAT:CAUS'           => new CauseOfEvent(I18N::translate('Cause of death')),
488                'INDI:DEAT:DATE'           => new DateValue(I18N::translate('Date of death')),
489                'INDI:DEAT:PLAC'           => new PlaceName(I18N::translate('Place of death')),
490                'INDI:DESI'                => new XrefSubmitter(I18N::translate('Descendants interest')),
491                'INDI:DSCR'                => new PhysicalDescription(I18N::translate('Description')),
492                'INDI:EDUC'                => new ScholasticAchievement(I18N::translate('Education')),
493                'INDI:EDUC:AGNC'           => new ResponsibleAgency(I18N::translate('School or college')),
494                'INDI:EMIG'                => new Emigration(I18N::translate('Emigration')),
495                'INDI:EMIG:DATE'           => new DateValue(I18N::translate('Date of emigration')),
496                'INDI:EMIG:PLAC'           => new PlaceName(I18N::translate('Place of emigration')),
497                'INDI:ENDL'                => new LdsEndowment(I18N::translate('LDS endowment')),
498                'INDI:ENDL:DATE'           => new DateLdsOrd(I18N::translate('Date of LDS endowment')),
499                'INDI:ENDL:NOTE'           => new NoteStructure(I18N::translate('Note')),
500                'INDI:ENDL:PLAC'           => new PlaceLivingOrdinance(I18N::translate('Place of LDS endowment')),
501                'INDI:ENDL:STAT'           => new LdsEndowmentDateStatus(I18N::translate('Status')),
502                'INDI:ENDL:STAT:DATE'      => new ChangeDate(I18N::translate('Status change date')),
503                'INDI:ENDL:TEMP'           => new TempleCode(I18N::translate('Temple')),
504                'INDI:EVEN'                => new EventDescriptor(I18N::translate('Event')),
505                'INDI:EVEN:DATE'           => new DateValue(I18N::translate('Date of event')),
506                'INDI:EVEN:PLAC'           => new PlaceName(I18N::translate('Place of event')),
507                'INDI:EVEN:TYPE'           => new EventAttributeType(I18N::translate('Type of event')),
508                'INDI:FACT'                => new AttributeDescriptor(I18N::translate('Fact')),
509                'INDI:FACT:TYPE'           => new EventAttributeType(I18N::translate('Type of fact')),
510                'INDI:FAMC'                => new XrefFamily(I18N::translate('Family as a child')),
511                'INDI:FAMC:NOTE'           => new NoteStructure(I18N::translate('Note')),
512                'INDI:FAMC:PEDI'           => new PedigreeLinkageType(I18N::translate('Relationship to parents')),
513                'INDI:FAMC:STAT'           => new ChildLinkageStatus(I18N::translate('Status')),
514                'INDI:FAMS'                => new XrefFamily(I18N::translate('Family as a spouse')),
515                'INDI:FCOM'                => new FirstCommunion(I18N::translate('First communion')),
516                'INDI:FCOM:DATE'           => new DateValue(I18N::translate('Date of first communion')),
517                'INDI:FCOM:PLAC'           => new PlaceName(I18N::translate('Place of first communion')),
518                'INDI:GRAD'                => new Graduation(I18N::translate('Graduation')),
519                'INDI:GRAD:AGNC'           => new ResponsibleAgency(I18N::translate('School or college')),
520                'INDI:IDNO'                => new NationalIdNumber(I18N::translate('Identification number')),
521                'INDI:IMMI'                => new Immigration(I18N::translate('Immigration')),
522                'INDI:IMMI:DATE'           => new DateValue(I18N::translate('Date of immigration')),
523                'INDI:IMMI:PLAC'           => new PlaceName(I18N::translate('Place of immigration')),
524                'INDI:NAME'                => new NamePersonal(I18N::translate('Name')),
525                'INDI:NAME:FONE'           => new NamePhoneticVariation(I18N::translate('Phonetic name'), ['TYPE' => '0,1']),
526                'INDI:NAME:FONE:GIVN'      => new NamePieceGiven(I18N::translate('Given names')),
527                'INDI:NAME:FONE:NICK'      => new NamePieceNickname(I18N::translate('Nickname')),
528                'INDI:NAME:FONE:NPFX'      => new NamePiecePrefix(I18N::translate('Name prefix')),
529                'INDI:NAME:FONE:NSFX'      => new NamePieceSuffix(I18N::translate('Name suffix')),
530                'INDI:NAME:FONE:SPFX'      => new NamePieceSurnamePrefix(I18N::translate('Surname prefix')),
531                'INDI:NAME:FONE:SURN'      => new NamePieceSurname(I18N::translate('Surname')),
532                'INDI:NAME:FONE:TYPE'      => new PhoneticType(I18N::translate('Phonetic type')),
533                'INDI:NAME:GIVN'           => new NamePieceGiven(I18N::translate('Given names')),
534                'INDI:NAME:NICK'           => new NamePieceNickname(I18N::translate('Nickname')),
535                'INDI:NAME:NOTE'           => new NoteStructure(I18N::translate('Note')),
536                'INDI:NAME:NPFX'           => new NamePiecePrefix(I18N::translate('Name prefix')),
537                'INDI:NAME:NSFX'           => new NamePieceSuffix(I18N::translate('Name suffix')),
538                'INDI:NAME:ROMN'           => new NameRomanizedVariation(I18N::translate('Romanized name'), ['TYPE' => '0,1']),
539                'INDI:NAME:ROMN:GIVN'      => new NamePieceGiven(I18N::translate('Given names')),
540                'INDI:NAME:ROMN:NICK'      => new NamePieceNickname(I18N::translate('Nickname')),
541                'INDI:NAME:ROMN:NPFX'      => new NamePiecePrefix(I18N::translate('Name prefix')),
542                'INDI:NAME:ROMN:NSFX'      => new NamePieceSuffix(I18N::translate('Name suffix')),
543                'INDI:NAME:ROMN:SPFX'      => new NamePieceSurnamePrefix(I18N::translate('Surname prefix')),
544                'INDI:NAME:ROMN:SURN'      => new NamePieceSurname(I18N::translate('Surname')),
545                'INDI:NAME:ROMN:TYPE'      => new RomanizedType(I18N::translate('Romanized type')),
546                'INDI:NAME:SPFX'           => new NamePieceSurnamePrefix(I18N::translate('Surname prefix')),
547                'INDI:NAME:SURN'           => new NamePieceSurname(I18N::translate('Surname')),
548                'INDI:NAME:TYPE'           => new NameType(I18N::translate('Type of name')),
549                'INDI:NATI'                => new NationOrTribalOrigin(I18N::translate('Nationality')),
550                'INDI:NATU'                => new Naturalization(I18N::translate('Naturalization')),
551                'INDI:NATU:DATE'           => new DateValue(I18N::translate('Date of naturalization')),
552                'INDI:NATU:PLAC'           => new PlaceName(I18N::translate('Place of naturalization')),
553                'INDI:NCHI'                => new CountOfChildren(I18N::translate('Number of children')),
554                'INDI:NMR'                 => new CountOfMarriages(I18N::translate('Number of marriages')),
555                'INDI:NOTE'                => new NoteStructure(I18N::translate('Note')),
556                'INDI:OBJE'                => new XrefMedia(I18N::translate('Media object')),
557                'INDI:OCCU'                => new Occupation(I18N::translate('Occupation')),
558                'INDI:OCCU:AGNC'           => new ResponsibleAgency(I18N::translate('Employer')),
559                'INDI:ORDN'                => new Ordination(I18N::translate('Ordination')),
560                'INDI:ORDN:AGNC'           => new Ordination(I18N::translate('Religious institution')),
561                'INDI:ORDN:DATE'           => new Ordination(I18N::translate('Date of ordination')),
562                'INDI:ORDN:PLAC'           => new Ordination(I18N::translate('Place of ordination')),
563                'INDI:PROB'                => new Probate(I18N::translate('Probate')),
564                'INDI:PROP'                => new Possessions(I18N::translate('Property')),
565                'INDI:REFN'                => new UserReferenceNumber(I18N::translate('Reference number')),
566                'INDI:REFN:TYPE'           => new UserReferenceType(I18N::translate('Type')),
567                'INDI:RELI'                => new ReligiousAffiliation(I18N::translate('Religion')),
568                'INDI:RESI'                => new Residence(I18N::translate('Residence')),
569                'INDI:RESI:DATE'           => new DateValue(I18N::translate('Date of residence')),
570                'INDI:RESI:PLAC'           => new PlaceName(I18N::translate('Place of residence')),
571                'INDI:RESN'                => new RestrictionNotice(I18N::translate('Restriction')),
572                'INDI:RETI'                => new Retirement(I18N::translate('Retirement')),
573                'INDI:RETI:AGNC'           => new ResponsibleAgency(I18N::translate('Employer')),
574                'INDI:RFN'                 => new PermanentRecordFileNumber(I18N::translate('Record file number')),
575                'INDI:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
576                'INDI:SEX'                 => new SexValue(I18N::translate('Gender')),
577                'INDI:SLGC'                => new LdsChildSealing(I18N::translate('LDS child sealing')),
578                'INDI:SLGC:DATE'           => new DateLdsOrd(I18N::translate('Date of LDS child sealing')),
579                'INDI:SLGC:FAMC'           => new XrefFamily(I18N::translate('Parents')),
580                'INDI:SLGC:NOTE'           => new NoteStructure(I18N::translate('Note')),
581                'INDI:SLGC:PLAC'           => new PlaceLivingOrdinance(I18N::translate('Place of LDS child sealing')),
582                'INDI:SLGC:STAT'           => new LdsChildSealingDateStatus(I18N::translate('Status')),
583                'INDI:SLGC:STAT:DATE'      => new ChangeDate(I18N::translate('Status change date')),
584                'INDI:SLGC:TEMP'           => new TempleCode(I18N::translate('Temple')),
585                'INDI:SOUR'                => new XrefSource(I18N::translate('Source')),
586                'INDI:SOUR:DATA'           => new SourceData(I18N::translate('Data')),
587                'INDI:SOUR:DATA:DATE'      => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
588                'INDI:SOUR:DATA:TEXT'      => new TextFromSource(I18N::translate('Text')),
589                'INDI:SOUR:EVEN'           => new EventTypeCitedFrom(I18N::translate('Event')),
590                'INDI:SOUR:EVEN:ROLE'      => new RoleInEvent(I18N::translate('Role')),
591                'INDI:SOUR:NOTE'           => new NoteStructure(I18N::translate('Note')),
592                'INDI:SOUR:OBJE'           => new XrefMedia(I18N::translate('Media object')),
593                'INDI:SOUR:PAGE'           => new WhereWithinSource(I18N::translate('Citation details')),
594                'INDI:SOUR:QUAY'           => new CertaintyAssessment(I18N::translate('Quality of data')),
595                'INDI:SSN'                 => new SocialSecurityNumber(I18N::translate('Social security number')),
596                'INDI:SUBM'                => new XrefSubmitter(I18N::translate('Submitter')),
597                'INDI:TITL'                => new NobilityTypeTitle(I18N::translate('Title')),
598                'INDI:WILL'                => new Will(I18N::translate('Will')),
599                'NOTE'                     => new NoteRecord(I18N::translate('Note')),
600                'NOTE:CHAN'                => new Change(I18N::translate('Last change')),
601                'NOTE:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
602                'NOTE:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
603                'NOTE:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
604                'NOTE:CONC'                => new SubmitterText(I18N::translate('Note')),
605                'NOTE:CONT'                => new SubmitterText(I18N::translate('Continued')),
606                'NOTE:REFN'                => new UserReferenceNumber(I18N::translate('Reference number')),
607                'NOTE:REFN:TYPE'           => new UserReferenceType(I18N::translate('Type')),
608                'NOTE:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
609                'NOTE:SOUR'                => new XrefSource(I18N::translate('Source')),
610                'NOTE:SOUR:DATA'           => new SourceData(I18N::translate('Data')),
611                'NOTE:SOUR:DATA:DATE'      => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
612                'NOTE:SOUR:DATA:TEXT'      => new TextFromSource(I18N::translate('Text')),
613                'NOTE:SOUR:EVEN'           => new EventTypeCitedFrom(I18N::translate('Event')),
614                'NOTE:SOUR:EVEN:ROLE'      => new RoleInEvent(I18N::translate('Role')),
615                'NOTE:SOUR:NOTE'           => new NoteStructure(I18N::translate('Note')),
616                'NOTE:SOUR:OBJE'           => new XrefMedia(I18N::translate('Media object')),
617                'NOTE:SOUR:PAGE'           => new WhereWithinSource(I18N::translate('Citation details')),
618                'NOTE:SOUR:QUAY'           => new CertaintyAssessment(I18N::translate('Quality of data')),
619                'OBJE'                     => new MediaRecord(I18N::translate('Media object')),
620                'OBJE:CHAN'                => new Change(I18N::translate('Last change')),
621                'OBJE:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
622                'OBJE:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
623                'OBJE:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
624                'OBJE:FILE'                => new MultimediaFileReference(I18N::translate('Filename')),
625                'OBJE:FILE:FORM'           => new MultimediaFormat(I18N::translate('Format')),
626                'OBJE:FILE:FORM:TYPE'      => new SourceMediaType(I18N::translate('Media type')),
627                'OBJE:FILE:TITL'           => new DescriptiveTitle(I18N::translate('Title')),
628                'OBJE:NOTE'                => new NoteStructure(I18N::translate('Note')),
629                'OBJE:REFN'                => new UserReferenceNumber(I18N::translate('Reference number')),
630                'OBJE:REFN:TYPE'           => new UserReferenceType(I18N::translate('Type')),
631                'OBJE:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
632                'OBJE:SOUR'                => new XrefSource(I18N::translate('Source')),
633                'OBJE:SOUR:DATA'           => new SourceData(I18N::translate('Data')),
634                'OBJE:SOUR:DATA:DATE'      => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
635                'OBJE:SOUR:DATA:TEXT'      => new TextFromSource(I18N::translate('Text')),
636                'OBJE:SOUR:EVEN'           => new EventTypeCitedFrom(I18N::translate('Event')),
637                'OBJE:SOUR:EVEN:ROLE'      => new RoleInEvent(I18N::translate('Role')),
638                'OBJE:SOUR:NOTE'           => new NoteStructure(I18N::translate('Note')),
639                'OBJE:SOUR:OBJE'           => new XrefMedia(I18N::translate('Media object')),
640                'OBJE:SOUR:PAGE'           => new WhereWithinSource(I18N::translate('Citation details')),
641                'OBJE:SOUR:QUAY'           => new CertaintyAssessment(I18N::translate('Quality of data')),
642                'REPO'                     => new RepositoryRecord(I18N::translate('Repository')),
643                'REPO:ADDR'                => new AddressLine(I18N::translate('Address')),
644                'REPO:ADDR:ADR1'           => new AddressLine1(I18N::translate('Address line 1')),
645                'REPO:ADDR:ADR2'           => new AddressLine2(I18N::translate('Address line 2')),
646                'REPO:ADDR:ADR3'           => new AddressLine3(I18N::translate('Address line 3')),
647                'REPO:ADDR:CITY'           => new AddressCity(I18N::translate('City')),
648                'REPO:ADDR:CTRY'           => new AddressCountry(I18N::translate('Country')),
649                'REPO:ADDR:POST'           => new AddressPostalCode(I18N::translate('Postal code')),
650                'REPO:ADDR:STAE'           => new AddressState(I18N::translate('State')),
651                'REPO:CHAN'                => new Change(I18N::translate('Last change')),
652                'REPO:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
653                'REPO:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
654                'REPO:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
655                'REPO:EMAIL'               => new AddressEmail(I18N::translate('Email address')),
656                'REPO:FAX'                 => new AddressFax(I18N::translate('Fax')),
657                'REPO:NAME'                => new NameOfRepository(I18N::translateContext('Repository', 'Name')),
658                'REPO:NOTE'                => new NoteStructure(I18N::translate('Note')),
659                'REPO:PHON'                => new PhoneNumber(I18N::translate('Phone')),
660                'REPO:REFN'                => new UserReferenceNumber(I18N::translate('Reference number')),
661                'REPO:REFN:TYPE'           => new UserReferenceType(I18N::translate('Type')),
662                'REPO:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
663                'REPO:WWW'                 => new AddressWebPage(I18N::translate('URL')),
664                'SOUR'                     => new SourceRecord(I18N::translate('Source')),
665                'SOUR:ABBR'                => new SourceFiledByEntry(I18N::translate('Abbreviation')),
666                'SOUR:AUTH'                => new SourceOriginator(I18N::translate('Author')),
667                'SOUR:CHAN'                => new Change(I18N::translate('Last change')),
668                'SOUR:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
669                'SOUR:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
670                'SOUR:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
671                'SOUR:DATA'                => new EmptyElement(I18N::translate('Data'), ['EVEN' => '0:M', 'AGNC' => '0:1', 'NOTE' => '0:M']),
672                'SOUR:DATA:AGNC'           => new ResponsibleAgency(I18N::translate('Agency')),
673                'SOUR:DATA:EVEN'           => new EventsRecorded(I18N::translate('Events')),
674                'SOUR:DATA:EVEN:DATE'      => new DateValue(I18N::translate('Date range')),
675                'SOUR:DATA:EVEN:PLAC'      => new SourceJurisdictionPlace(I18N::translate('Place')),
676                'SOUR:DATA:NOTE'           => new NoteStructure(I18N::translate('Note')),
677                'SOUR:NOTE'                => new NoteStructure(I18N::translate('Note')),
678                'SOUR:OBJE'                => new XrefMedia(I18N::translate('Media object')),
679                'SOUR:PUBL'                => new SourcePublicationFacts(I18N::translate('Publication')),
680                'SOUR:REFN'                => new UserReferenceNumber(I18N::translate('Reference number')),
681                'SOUR:REFN:TYPE'           => new UserReferenceType(I18N::translate('Type')),
682                'SOUR:REPO'                => new XrefRepository(I18N::translate('Repository')),
683                'SOUR:REPO:CALN'           => new SourceCallNumber(I18N::translate('Call number')),
684                'SOUR:REPO:CALN:MEDI'      => new SourceMediaType(I18N::translate('Media type')),
685                'SOUR:REPO:NOTE'           => new NoteStructure(I18N::translate('Note')),
686                'SOUR:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
687                'SOUR:TEXT'                => new TextFromSource(I18N::translate('Text')),
688                'SOUR:TITL'                => new DescriptiveTitle(I18N::translate('Title')),
689                'SUBM'                     => new SubmitterRecord(I18N::translate('Submitter')),
690                'SUBM:ADDR'                => new AddressLine(I18N::translate('Address')),
691                'SUBM:ADDR:ADR1'           => new AddressLine1(I18N::translate('Address line 1')),
692                'SUBM:ADDR:ADR2'           => new AddressLine2(I18N::translate('Address line 2')),
693                'SUBM:ADDR:ADR3'           => new AddressLine3(I18N::translate('Address line 3')),
694                'SUBM:ADDR:CITY'           => new AddressCity(I18N::translate('City')),
695                'SUBM:ADDR:CTRY'           => new AddressCountry(I18N::translate('Country')),
696                'SUBM:ADDR:POST'           => new AddressPostalCode(I18N::translate('Postal code')),
697                'SUBM:ADDR:STAE'           => new AddressState(I18N::translate('State')),
698                'SUBM:CHAN'                => new Change(I18N::translate('Last change')),
699                'SUBM:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
700                'SUBM:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
701                'SUBM:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
702                'SUBM:EMAIL'               => new AddressEmail(I18N::translate('Email address')),
703                'SUBM:FAX'                 => new AddressFax(I18N::translate('Fax')),
704                'SUBM:LANG'                => new LanguageId(I18N::translate('Language')),
705                'SUBM:NAME'                => new SubmitterName(I18N::translate('Name')),
706                'SUBM:NOTE'                => new NoteStructure(I18N::translate('Note')),
707                'SUBM:OBJE'                => new XrefMedia(I18N::translate('Media object')),
708                'SUBM:PHON'                => new PhoneNumber(I18N::translate('Phone')),
709                'SUBM:RFN'                 => new SubmitterRegisteredRfn(I18N::translate('Record file number')),
710                'SUBM:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
711                'SUBM:WWW'                 => new AddressWebPage(I18N::translate('URL')),
712                'SUBN'                     => new SubmissionRecord(I18N::translate('Submission')),
713                'SUBN:ANCE'                => new GenerationsOfAncestors(I18N::translate('Generations of ancestors')),
714                'SUBN:CHAN'                => new Change(I18N::translate('Last change')),
715                'SUBN:CHAN:DATE'           => new ChangeDate(I18N::translate('Date of last change')),
716                'SUBN:CHAN:DATE:TIME'      => new TimeValue(I18N::translate('Time')),
717                'SUBN:CHAN:NOTE'           => new NoteStructure(I18N::translate('Note')),
718                'SUBN:DESC'                => new GenerationsOfDescendants(I18N::translate('Generations of descendants')),
719                'SUBN:FAMF'                => new NameOfFamilyFile(I18N::translate('Family file')),
720                'SUBN:NOTE'                => new NoteStructure(I18N::translate('Note')),
721                'SUBN:ORDI'                => new OrdinanceProcessFlag(I18N::translate('Ordinance')),
722                'SUBN:RIN'                 => new AutomatedRecordId(I18N::translate('Record ID number')),
723                'SUBN:SUBM'                => new XrefSubmitter(I18N::translate('Submitter')),
724                'SUBN:TEMP'                => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')),
725                'TRLR'                     => new EmptyElement(I18N::translate('Trailer')),
726            ];
727
728            // Aldfaer extensions
729            $this->register([
730                'FAM:MARR_CIVIL'     => new CustomEvent(I18N::translate('Civil marriage')),
731                'FAM:MARR_RELIGIOUS' => new CustomEvent(I18N::translate('Religious marriage')),
732                'FAM:MARR_PARTNERS'  => new CustomEvent(I18N::translate('Registered partnership')),
733                'FAM:MARR_UNKNOWN'   => new CustomEvent(I18N::translate('Marriage type unknown')),
734            ]);
735
736            // Ancestry extensions
737            $this->register([
738                'INDI:*:SOUR:_APID' => new CustomElement(I18N::translate('Ancestry PID')),
739                'INDI:_EMPLOY'      => new CustomEvent(I18N::translate('Occupation')),
740            ]);
741
742            // Brother’s Keeper extensions
743            $this->register([
744                'FAM:*:_EVN'       => new CustomElement('Event number'),
745                'FAM:CHIL:_FREL'   => new CustomElement('Relationship to father'),
746                'FAM:CHIL:_MREL'   => new CustomElement('Relationship to mother'),
747                'FAM:_COML'        => new CustomEvent(I18N::translate('Common law marriage')),
748                'FAM:_MARI'        => new CustomEvent(I18N::translate('Marriage intention')),
749                'FAM:_MBON'        => new CustomEvent(I18N::translate('Marriage bond')),
750                'FAM:_NMR'         => new CustomEvent(I18N::translate('Not married'), ['NOTE' => '0:M', 'SOUR' => '0:M']),
751                'FAM:_PRMN'        => new CustomElement(I18N::translate('Permanent number')),
752                'FAM:_SEPR'        => new CustomEvent(I18N::translate('Separated')),
753                'FAM:_TODO'        => new CustomElement(I18N::translate('Research task')),
754                'INDI:*:_EVN'      => new CustomElement('Event number'),
755                'INDI:NAME:_ADPN'  => new NamePersonal(I18N::translate('Adopted name')),
756                'INDI:NAME:_AKAN'  => new NamePersonal(I18N::translate('Also known as')),
757                'INDI:NAME:_BIRN'  => new NamePersonal(I18N::translate('Birth name')),
758                'INDI:NAME:_CALL'  => new NamePersonal('Called name'),
759                'INDI:NAME:_CENN'  => new NamePersonal('Census name'),
760                'INDI:NAME:_CURN'  => new NamePersonal('Current name'),
761                'INDI:NAME:_FARN'  => new NamePersonal(I18N::translate('Estate name')),
762                'INDI:NAME:_FKAN'  => new NamePersonal('Formal name'),
763                'INDI:NAME:_FRKA'  => new NamePersonal('Formerly known as'),
764                'INDI:NAME:_GERN'  => new NamePersonal('German name'),
765                'INDI:NAME:_HEBN'  => new NamePersonal(I18N::translate('Hebrew name')),
766                'INDI:NAME:_HNM'   => new NamePersonal(I18N::translate('Hebrew name')),
767                'INDI:NAME:_INDG'  => new NamePersonal('Indigenous name'),
768                'INDI:NAME:_INDN'  => new NamePersonal('Indian name'),
769                'INDI:NAME:_LNCH'  => new NamePersonal('Legal name change'),
770                'INDI:NAME:_MARN'  => new NamePersonal('Married name'),
771                'INDI:NAME:_MARNM' => new NamePersonal('Married name'),
772                'INDI:NAME:_OTHN'  => new NamePersonal('Other name'),
773                'INDI:NAME:_RELN'  => new NamePersonal('Religious name'),
774                'INDI:NAME:_SHON'  => new NamePersonal('Short name'),
775                'INDI:NAME:_SLDN'  => new NamePersonal('Soldier name'),
776                'INDI:_ADPF'       => new CustomElement(I18N::translate('Adopted by father')),
777                'INDI:_ADPM'       => new CustomElement(I18N::translate('Adopted by mother')),
778                'INDI:_BRTM'       => new CustomEvent(I18N::translate('Brit milah')),
779                'INDI:_BRTM:DATE'  => new DateValue(I18N::translate('Date of brit milah')),
780                'INDI:_BRTM:PLAC'  => new PlaceName(I18N::translate('Place of brit milah')),
781                'INDI:_EMAIL'      => new AddressEmail(I18N::translate('Email address')),
782                'INDI:_EYEC'       => new CustomFact(I18N::translate('Eye color')),
783                'INDI:_FRNL'       => new CustomElement(I18N::translate('Funeral')),
784                'INDI:_HAIR'       => new CustomFact(I18N::translate('Hair color')),
785                'INDI:_HEIG'       => new CustomFact(I18N::translate('Height')),
786                'INDI:_INTE'       => new CustomElement(I18N::translate('Interment')),
787                'INDI:_MEDC'       => new CustomFact(I18N::translate('Medical')),
788                'INDI:_MILT'       => new CustomElement(I18N::translate('Military service')),
789                'INDI:_NLIV'       => new CustomFact(I18N::translate('Not living')),
790                'INDI:_NMAR'       => new CustomEvent(I18N::translate('Never married'), ['NOTE' => '0:M', 'SOUR' => '0:M']),
791                'INDI:_PRMN'       => new CustomElement(I18N::translate('Permanent number')),
792                'INDI:_TODO'       => new CustomElement(I18N::translate('Research task')),
793                'INDI:_WEIG'       => new CustomFact(I18N::translate('Weight')),
794                'INDI:_YART'       => new CustomEvent(I18N::translate('Yahrzeit')),
795                // 1 XXXX
796                // 2 _EVN ##
797                // 1 ASSO @Xnnn@
798                // 2 RELA Witness at event _EVN ##
799            ]);
800
801            // familysearch.org extensions
802            $this->register([
803                'INDI:_FSFTID' => /* I18N: familysearch.org */ new FamilySearchFamilyTreeId(I18N::translate('FamilySearch ID')),
804            ]);
805
806            // Family Tree Builder extensions
807            $this->register([
808                '*:_UPD'              => new CustomElement(I18N::translate('Last change')), // e.g. "1 _UPD 14 APR 2012 00:14:10 GMT-5"
809                'INDI:NAME:_AKA'      => new NamePersonal(I18N::translate('Also known as')),
810                'OBJE:_ALBUM'         => new CustomElement(I18N::translate('Album')), // XREF to an album
811                'OBJE:_DATE'          => new DateValue(I18N::translate('Date')),
812                'OBJE:_FILESIZE'      => new CustomElement(I18N::translate('File size')),
813                'OBJE:_PHOTO_RIN'     => new CustomElement(I18N::translate('Photo')),
814                'OBJE:_PLACE'         => new PlaceName(I18N::translate('Place')),
815                '_ALBUM:_PHOTO'       => new CustomElement(I18N::translate('Photo')),
816                '_ALBUM:_PHOTO:_PRIN' => new CustomElement(I18N::translate('Highlighted image')),
817            ]);
818
819            // Family Tree Maker extensions
820            $this->register([
821                'FAM:CHIL:_FREL'              => new CustomElement(I18N::translate('Relationship to father')),
822                'FAM:CHIL:_MREL'              => new CustomElement(I18N::translate('Relationship to mother')),
823                'FAM:_DETS'                   => new CustomElement(I18N::translate('Death of one spouse')),
824                'FAM:_FA1'                    => new CustomElement('Fact 1'),
825                'FAM:_FA10'                   => new CustomElement('Fact 10'),
826                'FAM:_FA11'                   => new CustomElement('Fact 11'),
827                'FAM:_FA12'                   => new CustomElement('Fact 12'),
828                'FAM:_FA13'                   => new CustomElement('Fact 13'),
829                'FAM:_FA2'                    => new CustomElement('Fact 2'),
830                'FAM:_FA3'                    => new CustomElement('Fact 3'),
831                'FAM:_FA4'                    => new CustomElement('Fact 4'),
832                'FAM:_FA5'                    => new CustomElement('Fact 5'),
833                'FAM:_FA6'                    => new CustomElement('Fact 6'),
834                'FAM:_FA7'                    => new CustomElement('Fact 7'),
835                'FAM:_FA8'                    => new CustomElement('Fact 8'),
836                'FAM:_FA9'                    => new CustomElement('Fact 9'),
837                'FAM:_MEND'                   => new CustomElement(I18N::translate('Marriage ending status')),
838                'FAM:_MSTAT'                  => new CustomElement(I18N::translate('Marriage beginning status')),
839                'FAM:_SEPR'                   => new CustomElement(I18N::translate('Separation')),
840                'HEAD:_SCHEMA'                => new CustomElement('Schema'),
841                'HEAD:_SCHEMA:FAM'            => new CustomElement(I18N::translate('Family')),
842                'HEAD:_SCHEMA:FAM:_FA*:LABL'  => new CustomElement(I18N::translate('Label')),
843                'HEAD:_SCHEMA:FAM:_FA1'       => new CustomElement(I18N::translate('Fact 1')),
844                'HEAD:_SCHEMA:FAM:_FA10'      => new CustomElement(I18N::translate('Fact 10')),
845                'HEAD:_SCHEMA:FAM:_FA11'      => new CustomElement(I18N::translate('Fact 11')),
846                'HEAD:_SCHEMA:FAM:_FA12'      => new CustomElement(I18N::translate('Fact 12')),
847                'HEAD:_SCHEMA:FAM:_FA13'      => new CustomElement(I18N::translate('Fact 13')),
848                'HEAD:_SCHEMA:FAM:_FA2'       => new CustomElement(I18N::translate('Fact 2')),
849                'HEAD:_SCHEMA:FAM:_FA3'       => new CustomElement(I18N::translate('Fact 3')),
850                'HEAD:_SCHEMA:FAM:_FA4'       => new CustomElement(I18N::translate('Fact 4')),
851                'HEAD:_SCHEMA:FAM:_FA5'       => new CustomElement(I18N::translate('Fact 5')),
852                'HEAD:_SCHEMA:FAM:_FA6'       => new CustomElement(I18N::translate('Fact 6')),
853                'HEAD:_SCHEMA:FAM:_FA7'       => new CustomElement(I18N::translate('Fact 7')),
854                'HEAD:_SCHEMA:FAM:_FA8'       => new CustomElement(I18N::translate('Fact 8')),
855                'HEAD:_SCHEMA:FAM:_FA9'       => new CustomElement(I18N::translate('Fact 9')),
856                'HEAD:_SCHEMA:FAM:_M*:LABL'   => new CustomElement(I18N::translate('Label')),
857                'HEAD:_SCHEMA:FAM:_MEND'      => new CustomElement(I18N::translate('Marriage ending status')),
858                'HEAD:_SCHEMA:FAM:_MSTAT'     => new CustomElement(I18N::translate('Marriage beginning status')),
859                'HEAD:_SCHEMA:INDI'           => new CustomElement(I18N::translate('Individual')),
860                'HEAD:_SCHEMA:INDI:_FA*:LABL' => new CustomElement(I18N::translate('Label')),
861                'HEAD:_SCHEMA:INDI:_FA1'      => new CustomElement(I18N::translate('Fact 1')),
862                'HEAD:_SCHEMA:INDI:_FA10'     => new CustomElement(I18N::translate('Fact 10')),
863                'HEAD:_SCHEMA:INDI:_FA11'     => new CustomElement(I18N::translate('Fact 11')),
864                'HEAD:_SCHEMA:INDI:_FA12'     => new CustomElement(I18N::translate('Fact 12')),
865                'HEAD:_SCHEMA:INDI:_FA13'     => new CustomElement(I18N::translate('Fact 13')),
866                'HEAD:_SCHEMA:INDI:_FA2'      => new CustomElement(I18N::translate('Fact 2')),
867                'HEAD:_SCHEMA:INDI:_FA3'      => new CustomElement(I18N::translate('Fact 3')),
868                'HEAD:_SCHEMA:INDI:_FA4'      => new CustomElement(I18N::translate('Fact 4')),
869                'HEAD:_SCHEMA:INDI:_FA5'      => new CustomElement(I18N::translate('Fact 5')),
870                'HEAD:_SCHEMA:INDI:_FA6'      => new CustomElement(I18N::translate('Fact 6')),
871                'HEAD:_SCHEMA:INDI:_FA7'      => new CustomElement(I18N::translate('Fact 7')),
872                'HEAD:_SCHEMA:INDI:_FA8'      => new CustomElement(I18N::translate('Fact 8')),
873                'HEAD:_SCHEMA:INDI:_FA9'      => new CustomElement(I18N::translate('Fact 9')),
874                'HEAD:_SCHEMA:INDI:_FREL'     => new CustomElement('Relationship to father'),
875                'HEAD:_SCHEMA:INDI:_M*:LABL'  => new CustomElement(I18N::translate('Label')),
876                'HEAD:_SCHEMA:INDI:_MREL'     => new CustomElement('Relationship to mother'),
877                'INDI:*:SOUR:_APID'           => new CustomElement('Ancestry.com source identifier'),
878                'INDI:*:SOUR:_LINK'           => new CustomElement('External link'),
879                'INDI:NAME:_AKA'              => new NamePersonal(I18N::translate('Also known as')),
880                'INDI:NAME:_MARNM'            => new NamePersonal(I18N::translate('Married name')),
881                'INDI:_CIRC'                  => new CustomElement('Circumcision'),
882                'INDI:_DCAUSE'                => new CustomElement(I18N::translate('Cause of death')),
883                'INDI:_DEG'                   => new CustomElement(I18N::translate('Degree')),
884                'INDI:_DNA'                   => new CustomElement(I18N::translate('DNA markers')),
885                'INDI:_ELEC'                  => new CustomElement('Elected'),
886                'INDI:_EMPLOY'                => new CustomElement('Employment'),
887                'INDI:_EXCM'                  => new CustomElement('Excommunicated'),
888                'INDI:_FA1'                   => new CustomElement('Fact 1'),
889                'INDI:_FA10'                  => new CustomElement('Fact 10'),
890                'INDI:_FA11'                  => new CustomElement('Fact 11'),
891                'INDI:_FA12'                  => new CustomElement('Fact 12'),
892                'INDI:_FA13'                  => new CustomElement('Fact 13'),
893                'INDI:_FA2'                   => new CustomElement('Fact 2'),
894                'INDI:_FA3'                   => new CustomElement('Fact 3'),
895                'INDI:_FA4'                   => new CustomElement('Fact 4'),
896                'INDI:_FA5'                   => new CustomElement('Fact 5'),
897                'INDI:_FA6'                   => new CustomElement('Fact 6'),
898                'INDI:_FA7'                   => new CustomElement('Fact 7'),
899                'INDI:_FA8'                   => new CustomElement('Fact 8'),
900                'INDI:_FA9'                   => new CustomElement('Fact 9'),
901                'INDI:_MDCL'                  => new CustomElement('Medical'),
902                'INDI:_MILT'                  => new CustomElement(I18N::translate('Military service')),
903                'INDI:_MILTID'                => new CustomElement('Military ID number'),
904                'INDI:_MISN'                  => new CustomElement('Mission'),
905                'INDI:_NAMS'                  => new CustomElement(I18N::translate('Namesake')),
906                'INDI:_UNKN'                  => new CustomElement(I18N::translate('Unknown')), // Special individual ID code for later file comparisons
907                // The context and meaning of these tags is unknown
908                '_FOOT'                       => new CustomElement(''),
909                '_FUN'                        => new CustomElement(''),
910                '_JUST'                       => new CustomElement(''),
911                '_PHOTO'                      => new CustomElement(''),
912            ]);
913
914            // Gedcom 5.3 extensions
915            $this->register([
916                'EVEN'                       => new CustomElement('Event'),
917                'EVEN:*:*:NAME'              => new NamePersonal(I18N::translate('Name')),
918                'EVEN:*:AUDIO'               => new CustomElement(I18N::translate('Audio')),
919                'EVEN:*:BROT'                => new PlaceName('Brother'),
920                'EVEN:*:BUYR'                => new PlaceName('Buyer'),
921                'EVEN:*:CHIL'                => new PlaceName('Child'),
922                'EVEN:*:DATE'                => new DateValue('Date'),
923                'EVEN:*:FATH'                => new PlaceName('Father'),
924                'EVEN:*:GODP'                => new PlaceName('Godparent'),
925                'EVEN:*:HDOH'                => new PlaceName('Head of household'),
926                'EVEN:*:HEIR'                => new PlaceName('Heir'),
927                'EVEN:*:HFAT'                => new PlaceName('Husband’s father'),
928                'EVEN:*:HMOT'                => new PlaceName('Husband’s mother'),
929                'EVEN:*:HUSB'                => new PlaceName('Husband'),
930                'EVEN:*:IMAGE'               => new CustomElement('Image'),
931                'EVEN:*:INDI'                => new PlaceName('Individual'),
932                'EVEN:*:INFT'                => new PlaceName('Informant'),
933                'EVEN:*:LEGA'                => new PlaceName('Legatee'),
934                'EVEN:*:MBR'                 => new PlaceName('Member'),
935                'EVEN:*:MOTH'                => new PlaceName('Mother'),
936                'EVEN:*:OFFI'                => new PlaceName('Official'),
937                'EVEN:*:PARE'                => new PlaceName('Parent'),
938                'EVEN:*:PHOTO'               => new CustomElement(I18N::translate('Photo')),
939                'EVEN:*:PHUS'                => new PlaceName('Previous husband'),
940                'EVEN:*:PLAC'                => new PlaceName('Place'),
941                'EVEN:*:PWIF'                => new PlaceName('Previous wife'),
942                'EVEN:*:RECO'                => new PlaceName('Recorder'),
943                'EVEN:*:REL'                 => new PlaceName('Relative'),
944                'EVEN:*:SELR'                => new PlaceName('Seller'),
945                'EVEN:*:SIBL'                => new PlaceName('Sibling'),
946                'EVEN:*:SIST'                => new PlaceName('Sister'),
947                'EVEN:*:SPOU'                => new PlaceName('Spouse'),
948                'EVEN:*:TXPY'                => new PlaceName('Taxpayer'),
949                'EVEN:*:VIDEO'               => new CustomElement(I18N::translate('Video')),
950                'EVEN:*:WFAT'                => new PlaceName('Wife’s father'),
951                'EVEN:*:WIFE'                => new PlaceName('Wife'),
952                'EVEN:*:WITN'                => new PlaceName('Witness'),
953                'EVEN:*:WMOT'                => new PlaceName('Wife’s mother'),
954                'EVEN:TYPE'                  => new CustomElement('Type of event'),
955                'FAM:*:*:QUAY'               => new CertaintyAssessment(I18N::translate('Quality of data')),
956                'FAM:*:PLAC:SITE'            => new CustomElement('Site'),
957                'FAM:*:QUAY'                 => new CertaintyAssessment(I18N::translate('Quality of data')),
958                'FAM:AUDIO'                  => new CustomElement(I18N::translate('Audio')),
959                'FAM:IMAGE'                  => new CustomElement('Image'),
960                'FAM:PHOTO'                  => new CustomElement(I18N::translate('Photo')),
961                'FAM:VIDEO'                  => new CustomElement(I18N::translate('Video')),
962                'HEAD:SCHEMA'                => new CustomElement(I18N::translate('Unknown')),
963                'HEAD:SCHEMA:FAM'            => new CustomElement(I18N::translate('Family')),
964                'HEAD:SCHEMA:FAM:*:_*'       => new CustomElement('Custom event'),
965                'HEAD:SCHEMA:FAM:*:_*:DEFN'  => new CustomElement('Definition'),
966                'HEAD:SCHEMA:FAM:*:_*:ISA'   => new CustomElement('Type of event'),
967                'HEAD:SCHEMA:FAM:*:_*:LABL'  => new CustomElement('Label'),
968                'HEAD:SCHEMA:FAM:_*'         => new CustomElement('Custom event'),
969                'HEAD:SCHEMA:FAM:_*:DEFN'    => new CustomElement('Definition'),
970                'HEAD:SCHEMA:FAM:_*:ISA'     => new CustomElement('Type of event'),
971                'HEAD:SCHEMA:FAM:_*:LABL'    => new CustomElement('Label'),
972                'HEAD:SCHEMA:INDI'           => new CustomElement(I18N::translate('Individual')),
973                'HEAD:SCHEMA:INDI:*:_*'      => new CustomElement('Custom event'),
974                'HEAD:SCHEMA:INDI:*:_*:DEFN' => new CustomElement('Definition'),
975                'HEAD:SCHEMA:INDI:*:_*:ISA'  => new CustomElement('Type of event'),
976                'HEAD:SCHEMA:INDI:*:_*:LABL' => new CustomElement('Label'),
977                'HEAD:SCHEMA:INDI:_*'        => new CustomElement('Custom event'),
978                'HEAD:SCHEMA:INDI:_*:DEFN'   => new CustomElement('Definition'),
979                'HEAD:SCHEMA:INDI:_*:ISA'    => new CustomElement('Type of event'),
980                'HEAD:SCHEMA:INDI:_*:LABL'   => new CustomElement('Label'),
981                'INDI:*:*:QUAY'              => new CertaintyAssessment(I18N::translate('Quality of data')),
982                'INDI:*:PLAC:SITE'           => new CustomElement('Site'),
983                'INDI:*:QUAY'                => new CertaintyAssessment(I18N::translate('Quality of data')),
984                'INDI:AUDIO'                 => new CustomElement(I18N::translate('Audio')),
985                'INDI:BURI:PLAC:CEME'        => new CustomElement(I18N::translate('Cemetery')),
986                'INDI:BURI:PLAC:CEME:PLOT'   => new CustomElement('Burial plot'),
987                'INDI:IMAGE'                 => new CustomElement('Image'),
988                'INDI:NAMR'                  => new CustomElement(I18N::translate('Religious name')),
989                'INDI:NAMS'                  => new CustomElement(I18N::translate('Namesake')),
990                'INDI:PHOTO'                 => new CustomElement(I18N::translate('Photo')),
991                'INDI:SIGN'                  => new CustomElement('Signature'),
992                'INDI:VIDEO'                 => new CustomElement(I18N::translate('Video')),
993                'REPO:CALN:ITEM'             => new CustomElement('Item'),
994                'REPO:CALN:PAGE'             => new CustomElement('Page'),
995                'REPO:CALN:SHEE'             => new CustomElement('Sheet'),
996                'REPO:CNTC'                  => new CustomElement('Contact person'),
997                'REPO:MEDI'                  => new SourceMediaType(I18N::translate('Media type')),
998                'REPO:REFN'                  => new CustomElement('Reference number'),
999                'SOUR:AUDIO'                 => new CustomElement(I18N::translate('Audio')),
1000                'SOUR:CENS'                  => new CustomElement('Census'),
1001                'SOUR:CENS:DATE'             => new CustomElement('Census'),
1002                'SOUR:CENS:DWEL'             => new CustomElement('Dwelling number'),
1003                'SOUR:CENS:FAMN'             => new CustomElement('Family number'),
1004                'SOUR:CENS:LINE'             => new CustomElement('Line number'),
1005                'SOUR:CLAS'                  => new CustomElement('Source classification'),
1006                'SOUR:CPLR'                  => new CustomElement('Compiler'),
1007                'SOUR:EDTR'                  => new CustomElement('Editor'),
1008                'SOUR:EVEN'                  => new CustomElement('Source events'),
1009                'SOUR:FIDE'                  => new CustomElement('Fidelity'),
1010                'SOUR:FILM'                  => new CustomElement(I18N::translate('Microfilm')),
1011                'SOUR:IMAGE'                 => new CustomElement('Image'),
1012                'SOUR:INDX'                  => new CustomElement('Indexed'),
1013                'SOUR:INTV'                  => new CustomElement('Interviewer'),
1014                'SOUR:ORIG'                  => new CustomElement('Originator'),
1015                'SOUR:ORIG:NAME'             => new CustomElement('Name'),
1016                'SOUR:ORIG:NOTE'             => new CustomElement('Note'),
1017                'SOUR:ORIG:TYPE'             => new CustomElement('Type'),
1018                'SOUR:PERI'                  => new CustomElement('Date period'),
1019                'SOUR:PHOTO'                 => new CustomElement(I18N::translate('Photo')),
1020                'SOUR:PUBL:DATE'             => new CustomElement('Date'),
1021                'SOUR:PUBL:EDTN'             => new CustomElement('Edition'),
1022                'SOUR:PUBL:ISSU'             => new CustomElement('Issue'),
1023                'SOUR:PUBL:LCCN'             => new CustomElement('Library of Congress call number'),
1024                'SOUR:PUBL:NAME'             => new CustomElement('Name'),
1025                'SOUR:PUBL:PUBR'             => new CustomElement('Publisher'),
1026                'SOUR:PUBL:SERS'             => new CustomElement('Series'),
1027                'SOUR:PUBL:TYPE'             => new CustomElement('Type'),
1028                'SOUR:QUAY'                  => new CertaintyAssessment(I18N::translate('Quality of data')),
1029                'SOUR:RECO'                  => new CustomElement('Recording agency?'),
1030                'SOUR:REFS'                  => new XrefSource('Referenced source'),
1031                'SOUR:REPO:DPRT:ARVL'        => new CustomElement('Departure'),
1032                'SOUR:REPO:DPRT:ARVL:DATE'   => new DateValue('Date'),
1033                'SOUR:REPO:DPRT:ARVL:PLAC'   => new PlaceName('Place'),
1034                'SOUR:REPO:NAME'             => new CustomElement('Name of vessel'),
1035                'SOUR:REPO:NOTE'             => new NoteStructure(I18N::translate('Note')),
1036                'SOUR:REPO:PORT'             => new CustomElement('Port'),
1037                'SOUR:REPO:PORT:ARVL'        => new CustomElement('Arrival'),
1038                'SOUR:REPO:PORT:ARVL:DATE'   => new DateValue('Date'),
1039                'SOUR:REPO:PORT:ARVL:PLAC'   => new PlaceName('Place'),
1040                'SOUR:REPO:TEXT'             => new TextFromSource(I18N::translate('Text')),
1041                'SOUR:SEQU'                  => new CustomElement('Sequence'),
1042                'SOUR:STAT'                  => new CustomElement('Search status'),
1043                'SOUR:STAT:DATE'             => new DateValue('Date'),
1044                'SOUR:TEXT'                  => new TextFromSource(I18N::translate('Text')),
1045                'SOUR:TYPE'                  => new CustomElement('Type of source'),
1046                'SOUR:VIDEO'                 => new CustomElement(I18N::translate('Video')),
1047                'SOUR:XLTR'                  => new CustomElement('Translator'),
1048            ]);
1049
1050            // Gedcom 5.5 extensions
1051            $this->register([
1052                'OBJE:BLOB' => new UnknownElement(I18N::translate('Binary data object')),
1053            ]);
1054
1055            // Gedcom-L extensions
1056            $this->register([
1057                'FAM:*:ADDR:_NAME'               => new CustomElement('Name of addressee'),
1058                'FAM:*:PLAC:_GOV'                => new GovIdentifier(I18N::translate('GOV identifier')),
1059                'FAM:*:PLAC:_LOC'                => new XrefLocation(I18N::translate('Location')),
1060                'FAM:*:PLAC:_MAIDENHEAD'         => new MaidenheadLocator('Maidenhead locator'),
1061                'FAM:*:PLAC:_POST'               => new AddressPostalCode('Postal code'),
1062                'FAM:*:PLAC:_POST:DATE'          => new DateValue(I18N::translate('Date')),
1063                'FAM:*:_ASSO'                    => new XrefIndividual(I18N::translate('Associate'), ['RELA' => '0:1', 'NOTE' => '0:M', 'SOUR' > '0:M']),
1064                'FAM:*:_ASSO:NOTE'               => new NoteStructure(I18N::translate('Note')),
1065                'FAM:*:_ASSO:RELA'               => new RelationIsDescriptor(I18N::translate('Relationship')),
1066                'FAM:*:_ASSO:SOUR'               => new XrefSource(I18N::translate('Source citation')),
1067                'FAM:_STAT'                      => new FamilyStatusText(I18N::translate('Family status')),
1068                'FAM:_STAT:DATE'                 => new DateValue(I18N::translate('Date')),
1069                'FAM:_STAT:NOTE'                 => new NoteStructure(I18N::translate('Note')),
1070                'FAM:_STAT:PLAC'                 => new PlaceName(I18N::translate('Place')),
1071                'FAM:_STAT:SOUR'                 => new XrefSource(I18N::translate('Source citation')),
1072                'FAM:_TODO'                      => new ResearchTask(I18N::translate('Research task')),
1073                'FAM:_TODO:DATA'                 => new SubmitterText(I18N::translate('The solution')),
1074                'FAM:_TODO:DATE'                 => new DateValue(I18N::translate('Creation date')),
1075                'FAM:_TODO:DESC'                 => new CustomElement(I18N::translate('Description')),
1076                'FAM:_TODO:NOTE'                 => new SubmitterText(I18N::translate('The problem')),
1077                'FAM:_TODO:REPO'                 => new XrefRepository('Repository'),
1078                'FAM:_TODO:STAT'                 => new ResearchTaskStatus(I18N::translate('Status')),
1079                'FAM:_TODO:TYPE'                 => new ResearchTaskType(I18N::translate('Type of research task')),
1080                'FAM:_TODO:_CAT'                 => new CustomElement(I18N::translate('Category')),
1081                'FAM:_TODO:_CDATE'               => new DateValue(I18N::translate('Completion date')),
1082                'FAM:_TODO:_PRTY'                => new ResearchTaskPriority(I18N::translate('Priority')),
1083                'FAM:_TODO:_RDATE'               => new DateValue(I18N::translate('Reminder date')),
1084                'FAM:_UID'                       => new PafUid(I18N::translate('Unique identifier')),
1085                'HEAD:SOUR:CORP:ADDR:_NAME'      => new CustomElement('Name of addressee'),
1086                'HEAD:_SCHEMA'                   => new EmptyElement(I18N::translate('Schema')),
1087                'HEAD:_SCHEMA:*'                 => new EmptyElement(I18N::translate('Base GEDCOM tag')),
1088                'HEAD:_SCHEMA:*:*'               => new EmptyElement(I18N::translate('New GEDCOM tag')),
1089                'HEAD:_SCHEMA:*:*:*'             => new EmptyElement(I18N::translate('New GEDCOM tag')),
1090                'HEAD:_SCHEMA:*:*:*:*'           => new EmptyElement(I18N::translate('New GEDCOM tag')),
1091                'HEAD:_SCHEMA:*:*:*:*:*'         => new EmptyElement(I18N::translate('New GEDCOM tag')),
1092                'HEAD:_SCHEMA:*:*:*:*:*:*'       => new EmptyElement(I18N::translate('New GEDCOM tag')),
1093                'HEAD:_SCHEMA:*:*:*:*:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')),
1094                'HEAD:_SCHEMA:*:*:*:*:*:_DEFN'   => new EmptyElement(I18N::translate('Definition')),
1095                'HEAD:_SCHEMA:*:*:*:*:_DEFN'     => new EmptyElement(I18N::translate('Definition')),
1096                'HEAD:_SCHEMA:*:*:*:_DEFN'       => new EmptyElement(I18N::translate('Definition')),
1097                'HEAD:_SCHEMA:*:*:_DEFN'         => new EmptyElement(I18N::translate('Definition')),
1098                'INDI:*:ADDR:_NAME'              => new CustomElement('Name of addressee'),
1099                'INDI:*:PLAC:_GOV'               => new GovIdentifier(I18N::translate('GOV identifier')),
1100                'INDI:*:PLAC:_LOC'               => new XrefLocation(I18N::translate('Location')),
1101                'INDI:*:PLAC:_MAIDENHEAD'        => new MaidenheadLocator('Maidenhead locator'),
1102                'INDI:*:PLAC:_POST'              => new AddressPostalCode('Postal code'),
1103                'INDI:*:PLAC:_POST:DATE'         => new DateValue(I18N::translate('Date')),
1104                'INDI:*:_ASSO'                   => new XrefIndividual(I18N::translate('Associate'), ['RELA' => '0:1', 'NOTE' => '0:M', 'SOUR' > '0:M']),
1105                'INDI:*:_ASSO:NOTE'              => new NoteStructure(I18N::translate('Note')),
1106                'INDI:*:_ASSO:RELA'              => new RelationIsDescriptor(I18N::translate('Relationship')),
1107                'INDI:*:_ASSO:SOUR'              => new XrefSource(I18N::translate('Source citation')),
1108                'INDI:*:_WITN'                   => new CustomElement('Witness'),
1109                'INDI:BAPM:_GODP'                => new CustomElement('Godparent'),
1110                'INDI:CHR:_GODP'                 => new CustomElement('Godparent'),
1111                'INDI:NAME:_RUFNAME'             => new NamePieceGiven(I18N::translate('Rufname')),
1112                'INDI:OBJE:_PRIM'                => new CustomElement(I18N::translate('Highlighted image')),
1113                'INDI:SEX'                       => new SexXValue(I18N::translate('Gender')),
1114                'INDI:_TODO'                     => new ResearchTask(I18N::translate('Research task')),
1115                'INDI:_TODO:DATA'                => new SubmitterText(I18N::translate('The solution')),
1116                'INDI:_TODO:DATE'                => new DateValue(I18N::translate('Creation date')),
1117                'INDI:_TODO:DESC'                => new CustomElement(I18N::translate('Description')),
1118                'INDI:_TODO:NOTE'                => new SubmitterText(I18N::translate('The problem')),
1119                'INDI:_TODO:REPO'                => new XrefRepository('Repository'),
1120                'INDI:_TODO:STAT'                => new ResearchTaskStatus(I18N::translate('Status')),
1121                'INDI:_TODO:TYPE'                => new ResearchTaskType(I18N::translate('Type of research task')),
1122                'INDI:_TODO:_CAT'                => new CustomElement(I18N::translate('Category')),
1123                'INDI:_TODO:_CDATE'              => new DateValue(I18N::translate('Completion date')),
1124                'INDI:_TODO:_PRTY'               => new ResearchTaskPriority(I18N::translate('Priority')),
1125                'INDI:_TODO:_RDATE'              => new DateValue(I18N::translate('Reminder date')),
1126                'INDI:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1127                'NOTE:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1128                'OBJE:FILE:_PRIM'                => new CustomElement(I18N::translate('Highlighted image')),
1129                'OBJE:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1130                'REPO:ADDR:_NAME'                => new CustomElement('Name of addressee'),
1131                'REPO:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1132                'SOUR:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1133                'SUBM:ADDR:_NAME'                => new CustomElement('Name of addressee'),
1134                'SUBM:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1135                'SUBN:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1136                '_LOC'                           => new LocationRecord(I18N::translate('Location')),
1137                '_LOC:CHAN'                      => new Change(I18N::translate('Last change')),
1138                '_LOC:CHAN:DATE'                 => new ChangeDate(I18N::translate('Date of last change')),
1139                '_LOC:CHAN:DATE:TIME'            => new TimeValue(I18N::translate('Time')),
1140                '_LOC:CHAN:NOTE'                 => new NoteStructure(I18N::translate('Note')),
1141                '_LOC:EVEN'                      => new EventDescriptor(I18N::translate('Event'), ['TYPE' => '0:1']),
1142                '_LOC:EVEN:TYPE'                 => new EventAttributeType(I18N::translate('Type of event')),
1143                '_LOC:MAP'                       => new EmptyElement(I18N::translate('Coordinates')),
1144                '_LOC:MAP:LATI'                  => new PlaceLatitude(I18N::translate('Latitude')),
1145                '_LOC:MAP:LONG'                  => new PlaceLongtitude(I18N::translate('Longitude')),
1146                '_LOC:NAME'                      => new PlaceName(I18N::translate('Place'), ['ABBR' => '0:1', 'DATE' => '0:1', 'LANG' => '0:1', 'SOUR' => '0:M']),
1147                '_LOC:NAME:ABBR'                 => new CustomElement(I18N::translate('Abbreviation')),
1148                '_LOC:NAME:ABBR:TYPE'            => new CustomElement(I18N::translate('Type of abbreviation')),
1149                '_LOC:NAME:DATE'                 => new DateValue(I18N::translate('Date')),
1150                '_LOC:NAME:LANG'                 => new LanguageId(I18N::translate('Language')),
1151                '_LOC:NAME:SOUR'                 => new XrefSource(I18N::translate('Source')),
1152                '_LOC:NOTE'                      => new NoteStructure(I18N::translate('Note')),
1153                '_LOC:OBJE'                      => new XrefMedia(I18N::translate('Media')),
1154                '_LOC:RELI'                      => new ReligiousAffiliation('Religion', []),
1155                '_LOC:SOUR'                      => new XrefSource(I18N::translate('Source')),
1156                '_LOC:SOUR:DATA'                 => new SourceData(I18N::translate('Data')),
1157                '_LOC:SOUR:DATA:DATE'            => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
1158                '_LOC:SOUR:DATA:TEXT'            => new TextFromSource(I18N::translate('Text')),
1159                '_LOC:SOUR:EVEN'                 => new EventTypeCitedFrom(I18N::translate('Event')),
1160                '_LOC:SOUR:EVEN:ROLE'            => new RoleInEvent(I18N::translate('Role')),
1161                '_LOC:SOUR:NOTE'                 => new NoteStructure(I18N::translate('Note')),
1162                '_LOC:SOUR:OBJE'                 => new XrefMedia(I18N::translate('Media object')),
1163                '_LOC:SOUR:PAGE'                 => new WhereWithinSource(I18N::translate('Citation details')),
1164                '_LOC:SOUR:QUAY'                 => new CertaintyAssessment(I18N::translate('Quality of data')),
1165                '_LOC:TYPE'                      => new CustomElement(I18N::translate('Type of location')),
1166                '_LOC:TYPE:DATE'                 => new DateValue(I18N::translate('Date')),
1167                '_LOC:TYPE:SOUR'                 => new XrefSource(I18N::translate('Source')),
1168                '_LOC:TYPE:_GOVTYPE'             => new CustomElement('GOV identifier type'),
1169                '_LOC:_AIDN'                     => new CustomElement('Administrative ID'),
1170                '_LOC:_AIDN:DATE'                => new DateValue(I18N::translate('Date')),
1171                '_LOC:_AIDN:SOUR'                => new XrefSource(I18N::translate('Source')),
1172                '_LOC:_AIDN:TYPE'                => new CustomElement(I18N::translate('Type of administrative ID')),
1173                '_LOC:_DMGD'                     => new CustomElement('Demographic data'),
1174                '_LOC:_DMGD:DATE'                => new DateValue(I18N::translate('Date')),
1175                '_LOC:_DMGD:SOUR'                => new XrefSource(I18N::translate('Source')),
1176                '_LOC:_DMGD:TYPE'                => new CustomElement(I18N::translate('Type of demographic data')),
1177                '_LOC:_GOV'                      => new GovIdentifier(I18N::translate('GOV identifier')),
1178                '_LOC:_LOC'                      => new XrefLocation(I18N::translate('Parent'), ['DATE' => '0:1', 'SOUR' => '0:M', 'TYPE' => '0:1']),
1179                '_LOC:_LOC:DATE'                 => new DateValue(I18N::translate('Date')),
1180                '_LOC:_LOC:SOUR'                 => new XrefSource(I18N::translate('Source')),
1181                '_LOC:_LOC:TYPE'                 => new HierarchicalRelationship(I18N::translate('Hierarchical relationship')),
1182                '_LOC:_MAIDENHEAD'               => new MaidenheadLocator('Maidenhead locator'),
1183                '_LOC:_POST'                     => new AddressPostalCode(I18N::translate('Postal code')),
1184                '_LOC:_POST:DATE'                => new DateValue(I18N::translate('Date')),
1185                '_LOC:_POST:SOUR'                => new XrefSource(I18N::translate('Source')),
1186                '_LOC:_UID'                      => new PafUid(I18N::translate('Unique identifier')),
1187                '_LOC:*:SOUR:DATA'               => new SourceData(I18N::translate('Data')),
1188                '_LOC:*:SOUR:DATA:DATE'          => new EntryRecordingDate(I18N::translate('Date of entry in original source')),
1189                '_LOC:*:SOUR:DATA:TEXT'          => new TextFromSource(I18N::translate('Text')),
1190                '_LOC:*:SOUR:EVEN'               => new EventTypeCitedFrom(I18N::translate('Event')),
1191                '_LOC:*:SOUR:EVEN:ROLE'          => new RoleInEvent(I18N::translate('Role')),
1192                '_LOC:*:SOUR:NOTE'               => new NoteStructure(I18N::translate('Note')),
1193                '_LOC:*:SOUR:OBJE'               => new XrefMedia(I18N::translate('Media object')),
1194                '_LOC:*:SOUR:PAGE'               => new WhereWithinSource(I18N::translate('Citation details')),
1195                '_LOC:*:SOUR:QUAY'               => new CertaintyAssessment(I18N::translate('Quality of data')),
1196            ]);
1197
1198            // Legacy extensions
1199            $this->register([
1200                'FAM:*:ADDR:_PRIV'             => new CustomElement('Indicates that an address or event is marked as Private.'),
1201                'FAM:*:PLAC:_VERI'             => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1202                'FAM:*:SOUR:_VERI'             => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1203                'FAM:*:_PRIV'                  => new CustomElement('Indicates that an address or event is marked as Private.'),
1204                'FAM:CHIL:_FREL'               => new CustomElement('The Relationship of a child to the Father (under a CHIL block under a FAM record).'),
1205                'FAM:CHIL:_MREL'               => new CustomElement('The Relationship of a child to the Mother (under a CHIL block under a FAM record).'),
1206                'FAM:CHIL:_STAT'               => new CustomElement('The Status of a marriage (Married, Unmarried, etc.).  Also the Status of a child (Twin, Triplet, etc.).  (The marriage status of Divorced is exported using a DIV tag.)'),
1207                'FAM:EVEN:_OVER'               => new CustomElement('An event sentence override (under an EVEN block).'),
1208                'FAM:MARR:_STAT'               => new CustomElement('The Status of a marriage (Married, Unmarried, etc.).  Also the Status of a child (Twin, Triplet, etc.).  (The marriage status of Divorced is exported using a DIV tag.)'),
1209                'FAM:SOUR:_VERI'               => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1210                'FAM:_NONE'                    => new CustomElement('Indicates that a couple had no children (under a FAM record).'),
1211                'HEAD:_EVENT_DEFN'             => new CustomElement('Indicates the start of an Event Definition record that describes the attributes of an event or fact.'),
1212                'HEAD:_EVENT_DEFN:_CONF_FLAG'  => new CustomElement('Indicates that an event is Confidential or Private (under an _EVENT_DEFN record).'),
1213                'HEAD:_EVENT_DEFN:_DATE_TYPE'  => new CustomElement('Indicates whether or not a Date field is shown for a specific event (under an _EVENT_DEFN record).'),
1214                'HEAD:_EVENT_DEFN:_DESC_FLAG'  => new CustomElement('Indicates whether or not a Description field is shown for a specific event (under an _EVENT_DEFN record).'),
1215                'HEAD:_EVENT_DEFN:_PLACE_TYPE' => new CustomElement('Indicates whether or not a Place field is shown for a specific event (under an _EVENT_DEFN record).'),
1216                'HEAD:_EVENT_DEFN:_PP_EXCLUDE' => new CustomElement('Indicates that an event is to be Excluded from the Potential Problems reporting (under an _EVENT_DEFN record).'),
1217                'HEAD:_EVENT_DEFN:_SEN1'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1218                'HEAD:_EVENT_DEFN:_SEN2'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1219                'HEAD:_EVENT_DEFN:_SEN3'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1220                'HEAD:_EVENT_DEFN:_SEN4'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1221                'HEAD:_EVENT_DEFN:_SEN5'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1222                'HEAD:_EVENT_DEFN:_SEN6'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1223                'HEAD:_EVENT_DEFN:_SEN7'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1224                'HEAD:_EVENT_DEFN:_SEN8'       => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'),
1225                'HEAD:_EVENT_DEFN:_SENDOF'     => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1226                'HEAD:_EVENT_DEFN:_SENDOM'     => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1227                'HEAD:_EVENT_DEFN:_SENDOU'     => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1228                'HEAD:_EVENT_DEFN:_SENDPF'     => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1229                'HEAD:_EVENT_DEFN:_SENDPM'     => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1230                'HEAD:_EVENT_DEFN:_SENDPU'     => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1231                'HEAD:_EVENT_DEFN:_SENF'       => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1232                'HEAD:_EVENT_DEFN:_SENM'       => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1233                'HEAD:_EVENT_DEFN:_SENPOF'     => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1234                'HEAD:_EVENT_DEFN:_SENPOM'     => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1235                'HEAD:_EVENT_DEFN:_SENPOU'     => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'),
1236                'HEAD:_EVENT_DEFN:_SENU'       => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'),
1237                'HEAD:_PLAC_DEFN'              => new CustomElement('Indicates the start of a Place Definition record that describes the attribute of a place.'),
1238                'HEAD:_PLAC_DEFN:_PREP'        => new CustomElement('A location Preposition (under a _PLAC_DEFN record).'),
1239                'INDI:*:ADDR:_LIST3 YES'       => new CustomElement('Indicates that a person’s address is part of the Birthday grouping (under an ADDR block).'),
1240                'INDI:*:ADDR:_LIST4 YES'       => new CustomElement('Indicates that a person’s address is part of the Research grouping (under an ADDR block).'),
1241                'INDI:*:ADDR:_LIST5 YES'       => new CustomElement('Indicates that a person’s address is part of the Christmas grouping (under an ADDR block).'),
1242                'INDI:*:ADDR:_LIST6 YES'       => new CustomElement('Indicates that a person’s address is part of the Holiday grouping (under an ADDR block).'),
1243                'INDI:*:ADDR:_NAME'            => new CustomElement('The name of an individual as part of an address (under an ADDR block).'),
1244                'INDI:*:ADDR:_PRIV'            => new CustomElement('Indicates that an address or event is marked as Private.'),
1245                'INDI:*:ADDR:_SORT'            => new CustomElement('The spelling of a name to be used when sorting addresses for a report (under an ADDR block).'),
1246                'INDI:*:ADDR:_TAG'             => new CustomElement('Indicates that an address, or place has been tagged.  Also used for Tag 1 selection for an individual.'),
1247                'INDI:*:PLAC:_TAG'             => new CustomElement('Indicates that an address, or place has been tagged.  Also used for Tag 1 selection for an individual.'),
1248                'INDI:*:PLAC:_VERI'            => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1249                'INDI:*:SOUR:_VERI'            => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1250                'INDI:*:_PRIV'                 => new CustomElement('Indicates that an address or event is marked as Private.'),
1251                'INDI:ADDR:_EMAIL'             => new CustomElement('An email address (under an ADDR block).'),
1252                'INDI:ADDR:_LIST1 YES'         => new CustomElement('Indicates that a person’s address is part of the Newsletter grouping (under an ADDR block).'),
1253                'INDI:ADDR:_LIST2 YES'         => new CustomElement('Indicates that a person’s address is part of the Family Association grouping (under an ADDR block).'),
1254                'INDI:EVEN:_OVER'              => new CustomElement('An event sentence override (under an EVEN block).'),
1255                'INDI:SOUR:_VERI'              => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'),
1256                'INDI:_TAG'                    => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1257                'INDI:_TAG2'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1258                'INDI:_TAG3'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1259                'INDI:_TAG4'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1260                'INDI:_TAG5'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1261                'INDI:_TAG6'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1262                'INDI:_TAG7'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1263                'INDI:_TAG8'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1264                'INDI:_TAG9'                   => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'),
1265                'INDI:_TODO'                   => new CustomElement('Research task'),
1266                'INDI:_TODO:_CAT'              => new CustomElement('The Category of a To-Do item (under a _TODO record).'),
1267                'INDI:_TODO:_CDATE'            => new CustomElement('Closed Date of a To-Do item (under a _TODO record).'),
1268                'INDI:_TODO:_LOCL'             => new CustomElement('The Locality of a To-Do item (under a _TODO record).'),
1269                'INDI:_TODO:_RDATE'            => new CustomElement('Reminder date on to-do items. (Under a _TODO record.)'),
1270                'INDI:_UID'                    => new CustomElement('A Unique Identification Number given to each individual in a family file.'),
1271                'INDI:_URL'                    => new CustomElement('An Internet address (under an INDI record).'),
1272                'OBJE:_DATE'                   => new CustomElement('A date associated with a multimedia object, usually a picture or video (under an OBJE block).'),
1273                'OBJE:_PRIM'                   => new CustomElement('Means a multimedia object, usually a picture, is the Primary object (the one that is shown on a report) (under an OBJE block).'),
1274                'OBJE:_SCBK'                   => new CustomElement('Indicates that a Picture is tagged to be included in a scrapbook report (under an OBJE block).'),
1275                'OBJE:_SOUND'                  => new CustomElement('A sound file name that is attached to a picture (under an OBJE block).'),
1276                'OBJE:_TYPE'                   => new CustomElement('The type of a multimedia object: Photo, Sound, or Video (under an OBJE block).'),
1277                'SOUR:_ITALIC Y'               => new CustomElement('Indicates that a source title should be printed on a report in italics (under a SOUR record).'),
1278                'SOUR:_PAREN'                  => new CustomElement('Indicates that the Publication Facts of a source should be printed within parentheses on a report (under a SOUR record).'),
1279                'SOUR:_QUOTED Y'               => new CustomElement('Indicates that a source title should be printed within quotes on a report (under a SOUR record).'),
1280                'SOUR:_TAG NO'                 => new CustomElement('When used under a SOUR record, indicates to exclude the source citation detail on reports.'),
1281                'SOUR:_TAG2 NO'                => new CustomElement('When used under a SOUR record, indicates to exclude the source citation on reports.'),
1282                'SOUR:_TAG3 YES'               => new CustomElement('When used under a SOUR record, indicates to include the source citation detail text on reports.'),
1283                'SOUR:_TAG4 YES'               => new CustomElement('When used under a SOUR record, indicates to include the source citation detail notes on reports.'),
1284                '_PREF'                        => new CustomElement('Indicates a Preferred spouse, child or parents.'), // How is this used?
1285            ]);
1286
1287            // Personal Ancestral File extensions
1288            $this->register([
1289                'INDI:NAME:_ADPN' => new NamePersonal(I18N::translate('Adopted name')),
1290                'INDI:NAME:_AKA'  => new NamePersonal(I18N::translate('Also known as')),
1291                'INDI:NAME:_AKAN' => new NamePersonal(I18N::translate('Also known as')),
1292                'INDI:_EMAIL'     => new AddressEmail(I18N::translate('Email address')),
1293                'URL'             => new CustomElement(I18N::translate('URL')),
1294                '_HEB'            => new CustomElement(I18N::translate('Hebrew')),
1295                '_NAME'           => new CustomElement(I18N::translate('Mailing name')),
1296                '_SCBK'           => new CustomElement(I18N::translate('Scrapbook')),
1297                '_SSHOW'          => new CustomElement(I18N::translate('Slide show')),
1298                '_TYPE'           => new CustomElement(I18N::translate('Media type')),
1299                '_URL'            => new CustomElement(I18N::translate('URL')),
1300            ]);
1301
1302            // PhpGedView extensions
1303            $this->register([
1304                'FAM:CHAN:_PGVU'        => new WebtreesUser(I18N::translate('Author of last change')),
1305                'FAM:COMM'              => new CustomElement(I18N::translate('Comment')),
1306                'INDI:BIRT:DATE:TIME'   => new TimeValue(I18N::translate('Time')),
1307                'INDI:BURI:CEME'        => new CustomElement(I18N::translate('Cemetery')),
1308                'INDI:CHAN:_PGVU'       => new WebtreesUser(I18N::translate('Author of last change')),
1309                'INDI:COMM'             => new CustomElement(I18N::translate('Comment')),
1310                'INDI:DEAT:DATE:TIME'   => new TimeValue(I18N::translate('Time')),
1311                'INDI:EMAIL'            => new AddressEmail(I18N::translate('Email address')),
1312                'INDI:NAME:_HEB'        => new NamePersonal(I18N::translate('Name in Hebrew')),
1313                'INDI:_FNRL'            => new CustomEvent(I18N::translate('Funeral')),
1314                'INDI:_HOL'             => new CustomEvent(I18N::translate('Holocaust')),
1315                'INDI:_MILI'            => new CustomEvent(I18N::translate('Military')),
1316                'INDI:_PGV_OBJS'        => new XrefMedia(I18N::translate('Re-order media')),
1317                'NOTE:CHAN:_PGVU'       => new WebtreesUser(I18N::translate('Author of last change')),
1318                'OBJE:CHAN:_PGVU'       => new WebtreesUser(I18N::translate('Author of last change')),
1319                'OBJE:_PRIM'            => new CustomElement(I18N::translate('Highlighted image')),
1320                'OBJE:_THUM'            => new CustomElement(I18N::translate('Thumbnail image')),
1321                'REPO:CHAN:_PGVU'       => new WebtreesUser(I18N::translate('Author of last change')),
1322                'SOUR:CHAN:_PGVU'       => new WebtreesUser(I18N::translate('Author of last change')),
1323                'SOUR:SERV'             => new CustomElement(I18N::translate('Remote server')),
1324                'SOUR:URL'              => new AddressWebPage(I18N::translate('URL')),
1325                'SOUR:URL:TYPE'         => new CustomElement(I18N::translate('Type')), // e.g. "FamilySearch"
1326                'SOUR:URL:_BLOCK'       => new CustomElement(I18N::translate('Block')), // "e.g. "false"
1327                'SOUR:_DBID'            => new CustomElement(I18N::translate('Database name')),
1328                'SOUR:_DBID:_PASS'      => new CustomElement(I18N::translate('Database password')),
1329                'SOUR:_DBID:_PASS:RESN' => new RestrictionNotice(I18N::translate('Restriction')),
1330                'SOUR:_DBID:_USER'      => new CustomElement(I18N::translate('Database user account')),
1331            ]);
1332
1333            // Reunion extensions
1334            $this->register([
1335                'INDI:EMAL'  => new AddressEmail(I18N::translate('Email address')),
1336                'INDI:CITN'  => new CustomElement(I18N::translate('Citizenship')),
1337                'INDI:_LEGA' => new CustomElement(I18N::translate('Legatee')),
1338                'INDI:_MDCL' => new CustomElement(I18N::translate('Medical')),
1339                'INDI:_PURC' => new CustomElement('Land purchase'),
1340                'INDI:_SALE' => new CustomElement('Land sale'),
1341            ]);
1342
1343            // Roots Magic extensions
1344            $this->register([
1345                'INDI:_DNA'  => new CustomElement(I18N::translate('DNA markers')),
1346                'SOUR:_BIBL' => new CustomElement(I18N::translate('Bibliography')),
1347                'SOUR:_SUBQ' => new CustomElement(I18N::translate('Abbreviation')),
1348            ]);
1349
1350            // webtrees extensions
1351            $this->register([
1352                'FAM:CHAN:_WT_USER'  => new WebtreesUser(I18N::translate('Author of last change')),
1353                'FAM:_UID'           => new PafUid(I18N::translate('Unique identifier')),
1354                'INDI:*:ASSO'        => new XrefIndividual(I18N::translate('Associate'), ['RELA' => '0:1']),
1355                'INDI:*:ASSO:RELA'   => new RelationIsDescriptor(I18N::translate('Relationship')),
1356                'INDI:*:PLAC:_HEB'   => new NoteStructure(I18N::translate('Place in Hebrew')),
1357                'INDI:ADDR'          => new AddressLine(I18N::translate('Address')),
1358                'INDI:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1359                'INDI:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1360                'INDI:_WT_OBJE_SORT' => new XrefMedia(I18N::translate('Re-order media')),
1361                'NOTE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1362                'NOTE:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1363                'NOTE:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1364                'OBJE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1365                'OBJE:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1366                'OBJE:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1367                'REPO:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1368                'REPO:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1369                'REPO:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1370                'SOUR:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1371                'SOUR:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1372                'SOUR:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1373                'SUBM:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1374                'SUBM:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1375                'SUBM:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1376                'SUBN:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')),
1377                'SUBN:RESN'          => new RestrictionNotice(I18N::translate('Restriction')),
1378                'SUBN:_UID'          => new PafUid(I18N::translate('Unique identifier')),
1379            ]);
1380        }
1381
1382        return $this->elements;
1383    }
1384
1385    /**
1386     * Register more elements.
1387     *
1388     * @param array<string,ElementInterface> $elements
1389     */
1390    public function register(array $elements): void
1391    {
1392        $this->elements = array_merge($this->elements(), $elements);
1393    }
1394
1395    /**
1396     * @param string $tag
1397     *
1398     * @return ElementInterface|null
1399     */
1400    private function findElementByWildcard(string $tag): ?ElementInterface
1401    {
1402        foreach ($this->elements() as $tags => $element) {
1403            if (strpos($tags, '*') !== false) {
1404                $regex = '/^' . strtr($tags, ['*' => '[^:]+']) . '$/';
1405
1406                if (preg_match($regex, $tag)) {
1407                    return $element;
1408                }
1409            }
1410        }
1411
1412        return null;
1413    }
1414}
1415