You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.9 KiB

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