src/ets.php
function store_leaf(&$elts, $ptype, &$i, $cname, $cvalue = NULL)
	{
		$isabsolute = FALSE;
		if ($cname{0} == '/' && $cname{1} == '/') {
			$isabsolute = TRUE;
			$cname = substr($cname, 2);
		}
		$elements = explode('/', $cname);
		if (count($elements) == 1 && !$isabsolute) {
			$elts[$ptype . ':' . $i . ':' . $cname . ':' . $cvalue] = '';
		} else {
			if ($isabsolute) {
				$elts[_ETS_TEMPLATE . ':' . $i . '.1://'] = $this->leaf_path_walk($elements, 2, $ptype, $i, $cvalue);
			} else {
				$element1 = array_shift($elements);
				$elts[_ETS_TEMPLATE . ':' . $i . '.1:' . $element1] = $this->leaf_path_walk($elements, 2, $ptype, $i, $cvalue);
			}
		}
	}
function store_leaf(&$elts, $ptype, &$i, $cname, $cvalue = NULL)
	{
		$isabsolute = FALSE;
		if ($cname{0} == '/' && $cname{1} == '/') {
			$isabsolute = TRUE;
			$cname = substr($cname, 2);
		}
		$elements = explode('/', $cname);
		if (count($elements) == 1 && !$isabsolute) {
			$elts[$ptype . ':' . $i . ':' . $cname . ':' . $cvalue] = '';
		} else {
			if ($isabsolute) {
				$elts[_ETS_TEMPLATE . ':' . $i . '.1://'] = $this->leaf_path_walk($elements, 2, $ptype, $i, $cvalue);
			} else {
				$element1 = array_shift($elements);
				$elts[_ETS_TEMPLATE . ':' . $i . '.1:' . $element1] = $this->leaf_path_walk($elements, 2, $ptype, $i, $cvalue);
			}
		}
	}
Store a new leaf in the template tree