Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Creating Family Records
The
is translated to the output element
Here is the code to do this:
One point worth noting here is the use of
select=“HUSB,
WIFE,
CHIL”
to ensure that the elements of the family appear in the right order in the output. The GEDCOM 6.0 schema is very strict about the order of elements, whereas GEDCOM 5.5 was more liberal. This expression selects a sequence containing zero-or-one
HUSB
elements, zero-or-one
WIFE
elements, and zero-or-more
CHIL
elements, and processes them in that order.
If the input GEDCOM file is invalid, for example if a
FAM
contains more than one
WIFE
element, then the output file will also be invalid, and this will cause a validation error to be reported by the XSLT processor.
Creating Individual Records
The code for mapping
Note the code here for extracting the surname from the name using the
/
characters; in 6.0, it is enclosed in a nested
Jr
) and so on, but as such fields aren't marked up in our source data, we can't generate them.
The rules for
NOTE
elements apply to such elements wherever they appear in a GEDCOM file, which is why the patterns specify
match=“NOTE”
rather than
match=“INDI/NOTE”
; for other elements, the rules may be specific to their use within an