Validate an xref provided explicitly or implicitly (through the active record).

get_valid_xref(gedcom, xref, record_type, record_type_fn)

Arguments

gedcom

A tidyged object.

xref

A record xref.

record_type

A character string describing the record type. Generally one of the global record_string_* values.

record_type_fn

A function to check the record type. Generally one of the is_* functions.

Value

A valid xref identifier.

Details

This helper function is designed to derive and run validation checks on an xref provided explicitly or implicitly. An xref is provided implicitly through the active record of the tidyged object.

Once found, the xref is checked to ensure it is of the appropriate type.