LifeLines Programmers Reference

Version 3.0.2

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines


GEDCOM Node Functions

These functions provide access to the components of a GEDCOM node. All take a GEDCOM node as their first parameter, and each returns a different value associated with the node.

FunctionDescription
string xref(node) Xref returns the cross reference index of the node. If there is no cross reference, xref returns null.
string tag(node) Tag returns the tag of the node.
string value(node) Value returns the value of the node. If there is no value, value returns null.
node parent(node) Parent, child and sibling navigate to related nodes in a GEDCOM tree. Whenever there is no such related node, these functions return null. Parent returns the parent node of the node, if any.
node child(node) Child returns the first child node of the node, if any.
node sibling(node) Sibling returns the next sibling node of the node, if any.
node savenode(node) Savenode makes a copy of the node, and the structure of nodes below it. Beware: the memory used to make the copy is never returned to the system.
fornodes (node, node_v) { } Fornodes is an iterator that loops through the child nodes of a GEDCOM node. Its first argument is a node expression, and its second parameter is a variable that iterates through each direct child node of the first node.
traverse (node, node_v, int_v) { } Traverse is an iterator providing a general method for traversing GEDCOM trees. Its first parameter is a node expression; its second parameter is a variable that iterates over every node under the first node in a top down, left to right manner; and its third parameter is a variable that is set to the level of the current node in the iteration.

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines

1/1/00