Skip to content

Problem with CONC lines in SOUR PAGE for a RESI ATTR #15

@stuporglue

Description

@stuporglue

The source reference ID for a RESI ATTR is coming out as

@s19@World War II Draft Cards (Fourth Registration) for the State ofWisconsin; State Headquarters: Wisconsin; Record Group Name: Recordsof the Selective Service System, 1940-; Record Group

I have been able to simplify the GEDCOM file and still reproduce it:

0 HEAD
0 @I212@ INDI
1 NAME Bob The /Frog/
1 RESI Age: 55
2 SOUR @S19@
3 PAGE National Archives and Records Administration (NARA); Washington, D.C.; 
4 CONC World War II Draft Cards (Fourth Registration) for the State of 
4 CONC Wisconsin; State Headquarters: Wisconsin; Record Group Name: Records 
4 CONC of the Selective Service System, 1940-; Record Group
0 TRLR

I think the ID should just be S19.

Here's my code:

<?php

spl_autoload_register(function ($class) {
    $pathToPhpGedcom = __DIR__ . '/library/'; // TODO FIXME

    if (!substr(ltrim($class, '\\'), 0, 7) == 'PhpGedcom\\') {
        return;
    }

    $class = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
    if (file_exists($pathToPhpGedcom . $class)) {
        require_once($pathToPhpGedcom . $class);
    }
});

$parser = new \PhpGedcom\Parser();
$gedcom = $parser->parse('family.ged');

foreach ($gedcom->getIndi() as $individual) {
    print  $individual->getId() . ': ' . current($individual->getName())->getName() . "<br>\n";
    foreach($individual->getAttr() as $attr){
        print $attr->getType() . ": <br>\n";
        foreach($attr->getSour() as $sour){
            print "The Source ID IS: <br>\n";
            print $sour->getSour() . "<br>\n";
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions