src/ets.php
function leaf_path_walk($elements, $rank, $ptype, &$i, $cvalue)
	{
		if (count($elements) == 1) {
			$elt[$ptype . ':' . $i . ':' . $elements[0] . ':' . $cvalue] = '';
		} else {
			$element1 = array_shift($elements);
			$elt[_ETS_TEMPLATE . ':' . $i . '.' . $rank . ':' . $element1] = $this->leaf_path_walk($elements, $rank + 1, $ptype, $i, $cvalue);
		}
		return $elt;
	}
function leaf_path_walk($elements, $rank, $ptype, &$i, $cvalue)
	{
		if (count($elements) == 1) {
			$elt[$ptype . ':' . $i . ':' . $elements[0] . ':' . $cvalue] = '';
		} else {
			$element1 = array_shift($elements);
			$elt[_ETS_TEMPLATE . ':' . $i . '.' . $rank . ':' . $element1] = $this->leaf_path_walk($elements, $rank + 1, $ptype, $i, $cvalue);
		}
		return $elt;
	}
Walk through a slash separated path of a leaf to build a tree