| 1 |
lars |
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 |
*/
|
|
|
28 |
import("org.active-link.xml.XML");
|
|
|
29 |
import("org.active-link.xml.XMLBranch");
|
|
|
30 |
import("org.active-link.xml.Leaf");
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* XMLLeaf class provides means to store text values for use in XML tree
|
|
|
34 |
* @class XMLLeaf
|
|
|
35 |
* @package org.active-link.xml
|
|
|
36 |
* @author Zurab Davitiani
|
|
|
37 |
* @version 0.4.0
|
|
|
38 |
* @extends Leaf
|
|
|
39 |
* @requires Leaf
|
|
|
40 |
* @see XML
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
class XMLLeaf extends Leaf {
|
|
|
44 |
|
|
|
45 |
var $parentXML;
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
* Gets parent object of the XML leaf
|
|
|
49 |
* @method getParentXML
|
|
|
50 |
* @returns parent object of the XML leaf
|
|
|
51 |
*/
|
|
|
52 |
function getParentXML() {
|
|
|
53 |
return $this->parentXML;
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
* Sets parent object of the XML leaf
|
|
|
58 |
* @method setParentXML
|
|
|
59 |
* @param object xml
|
|
|
60 |
* @returns true if successful, false otherwise
|
|
|
61 |
*/
|
|
|
62 |
function setParentXML(&$xml) {
|
|
|
63 |
$success = false;
|
|
|
64 |
if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") {
|
|
|
65 |
$this->parentXML = &$xml;
|
|
|
66 |
$success = true;
|
|
|
67 |
}
|
|
|
68 |
return $success;
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
?>
|