Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fXML.php
r702 r796 Hide Line Numbers 6 6 * http://flourishlib.com/docs/UTF-8 for more information. 7 7 * 8 * @copyright Copyright (c) 2007-20 09Will Bond8 * @copyright Copyright (c) 2007-2010 Will Bond 9 9 * @author Will Bond [wb] <will@flourishlib.com> 10 10 * @license http://flourishlib.com/license … … 13 13 * @link http://flourishlib.com/fXML 14 14 * 15 * @version 1.0.0b3 15 * @version 1.0.0b4 16 * @changes 1.0.0b4 Updated the class to automatically add a `__` prefix for the default namespace and to use that for attribute and child element access [wb, 2010-04-06] 16 17 * @changes 1.0.0b3 Added the `$http_timeout` parameter to ::__construct() [wb, 2009-09-16] 17 18 * @changes 1.0.0b2 Added instance functionality for reading of XML files [wb, 2009-09-01] … … 156 157 if (!$this->__dom) { 157 158 $this->__dom = dom_import_simplexml($xml); 159 } 160 161 if ($this->__dom->namespaceURI && $this->__dom->prefix == '') { 162 $this->addCustomPrefix('__', $this->__dom->namespaceURI); 158 163 } 159 164 } … … 200 205 } 201 206 207 if ($this->__dom->namespaceURI && $this->__dom->prefix == '' && strpos($name, ':') === FALSE) { 208 $name = '__:' . $name; 209 } 202 210 $first_child = $this->query($name . '[1]'); 203 211 if ($first_child->length) { … … 222 230 public function __isset($name) 223 231 { 224 return (boolean) $this->query($name . '[1]')->length; 232 if ($this->__dom->namespaceURI && $this->__dom->prefix == '' && strpos($name, ':') === FALSE) { 233 $name = '__:' . $name; 234 } 235 return (boolean) $this->query($name . '[1]')->length; 225 236 } 226 237 … … 515 526 $child = new fXML($element); 516 527 $child->__custom_prefixes = $this->__custom_prefixes; 528 if ($child->__dom->namespaceURI && $child->__dom->prefix == '') { 529 $child->addCustomPrefix('__', $child->__dom->namespaceURI); 530 } 517 531 $output[] = $child; 518 532 … … 568 582 569 583 /** 570 * Copyright (c) 2007-20 09Will Bond <will@flourishlib.com>584 * Copyright (c) 2007-2010 Will Bond <will@flourishlib.com> 571 585 * 572 586 * Permission is hereby granted, free of charge, to any person obtaining a copy
