1<?php
2
3/*
4	This file is part of ActiveLink PHP XML Package (www.active-link.com).
5	Copyright (c) 2002-2004 by Zurab Davitiani
6
7	You can contact the author of this software via E-mail at
8	hattrick@mailcan.com
9
10	ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
11	it under the terms of the GNU Lesser General Public License as published by
12	the Free Software Foundation; either version 2.1 of the License, or
13	(at your option) any later version.
14
15	ActiveLink PHP XML Package is distributed in the hope that it will be useful,
16	but WITHOUT ANY WARRANTY; without even the implied warranty of
17	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18	GNU Lesser General Public License for more details.
19
20	You should have received a copy of the GNU Lesser General Public License
21	along with ActiveLink PHP XML Package; if not, write to the Free Software
22	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23*/
24
25/*
26 *	requires XML class
27 */
28import("org.active-link.xml.XML");
29
30/**
31  *	XMLBranch class provides a tree-like structure to read/write/modify XML
32  *	@class		XMLBranch
33  *	@package	org.active-link.xml
34  *	@author		Zurab Davitiani
35  *	@version	0.4.0
36  *	@extends	XML
37  *	@requires	XML
38  *	@see		Tree
39  */
40
41class XMLBranch extends XML {
42
43	var $parentXML;
44
45	/**
46	  *	Gets parent object of the XML branch
47	  *	@method		getParentXML
48	  *	@returns	parent object of the XML branch
49	  */
50	function getParentXML() {
51		return $this->parentXML;
52	}
53
54	/**
55	  *	Sets parent object of the XML branch
56	  *	@method		setParentXML
57	  *	@param		object xml
58	  *	@returns	true if successful, false otherwise
59	  */
60	function setParentXML(&$xml) {
61		$success = false;
62		if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") {
63			$this->parentXML = &$xml;
64			$success = true;
65		}
66		return $success;
67	}
68
69}
70
71?>
72