Person::toXml - jcobban/Genealogy GitHub Wiki

$person->toXml($top, $print, $options)

Up: class Person

This method creates an Extensible Markup Language (XML) document. This document contains a tag for each field in the associated database record whose name is the name of the field, and which encloses the textual value of the field. This is used by many PHP scripts, in particular those that permit Javascript to use AJAX to retrieve the contents of a database record for dynamic display to the user. The function returns the generated XML document as a string. The script getRecordXml.php can be used to invoke this method for a particular instance of Person and display the XML document.

parameter description
$top A string containing the the tag name to use for the root XML tag of the document. If this is not a string or is an empty string it is replaced by the class name in lower case.
$print If this is omitted or is boolean true the XML document is also sent to standard output. This can also be specified as an array of settings: 'print' may be set to boolean false, and 'idcr' may be set to boolean true to request that the response include fields that are only relevant to a child or to the default false to ignore those fields.
$options This contains a bit mask.

The bit mask of $options may include any of the following options combined by bit-wise OR:

option name action
Person::TOXML_INCLUDE_FAMILIES the document includes information on families in which the Person is a spouse
Person::TOXML_INCLUDE_PARENTS the document includes information on families in which the Person is a child
Person::TOXML_INCLUDE_NAMES the document includes all of the Names of this Person. If not specified only the primary name is included
Person::TOXML_INCLUDE_EVENTS the document includes the individual events for this Person

This method is customized to interpret the following fields:

fieldname display as
gender the gender is interpreted as a letter 'M' or 'F'.
living a flag field interpreted as a letter 'Y' or 'N' or as null.
templetag a flag field interpreted as a letter 'Y' or 'N' or as null.
tag1 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag2 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag3 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag4 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag5 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag6 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag7 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag8 a flag field interpreted as a letter 'Y' or 'N' or as null.
tag9 a flag field interpreted as a letter 'Y' or 'N' or as null.
taggroup a flag field interpreted as a letter 'Y' or 'N' or as null.
taganc a flag field interpreted as a letter 'Y' or 'N' or as null.
tagdec a flag field interpreted as a letter 'Y' or 'N' or as null.
savetag a flag field interpreted as a letter 'Y' or 'N' or as null.
srchtag a flag field interpreted as a letter 'Y' or 'N' or as null.
srchtagigi a flag field interpreted as a letter 'Y' or 'N' or as null.
srchtagrg a flag field interpreted as a letter 'Y' or 'N' or as null.
srchtagfs a flag field interpreted as a letter 'Y' or 'N' or as null.
qstag a flag field interpreted as a letter 'Y' or 'N' or as null.
remindertag a flag field interpreted as a letter 'Y' or 'N' or as null.
remindertagdeath a flag field interpreted as a letter 'Y' or 'N' or as null.
treenum a flag field interpreted as a letter 'Y' or 'N' or as null.
alreadyused a flag field interpreted as a letter 'Y' or 'N' or as null.
ppcheck a flag field interpreted as a letter 'Y' or 'N' or as null.
imported a flag field interpreted as a letter 'Y' or 'N' or as null.
nevermarried a flag field interpreted as a letter 'Y' or 'N' or as null.
directline a flag field interpreted as a letter 'Y' or 'N' or as null.
private a flag field interpreted as a letter 'Y' or 'N' or as null.
fssync a flag field interpreted as a letter 'Y' or 'N' or as null.
fsdups a flag field interpreted as a letter 'Y' or 'N' or as null.
fsordinance a flag field interpreted as a letter 'Y' or 'N' or as null.
fslinks a flag field interpreted as a letter 'Y' or 'N' or as null.
idmrparents suppressed if 'child' set to true.
idmrpref suppressed if 'child' set to true.
idar suppressed if 'child' set to true.
ancinterest suppressed if 'child' set to true.
decinterest suppressed if 'child' set to true.
ancestralref suppressed if 'child' set to true.
colortag suppressed if 'child' set to true.
ltmp1 suppressed if 'child' set to true.
ltmp2 suppressed if 'child' set to true.
ppexclude suppressed if 'child' set to true.
rgexclude suppressed if 'child' set to true.
stmp1 suppressed if 'child' set to true.
relations suppressed if 'child' set to true.
intellishare suppressed if 'child' set to true.
dna suppressed if 'child' set to true.
added suppressed if 'child' set to true.
addedtime suppressed if 'child' set to true.
updated suppressed if 'child' set to true.
updatedtime suppressed if 'child' set to true.

This returns the document as a string.

Next: $person->toJson($print, $options)