Example #1
0
 /**
  * This method returns an object for the specified element.
  *
  * @access public
  * @param \SimpleXMLElement $element                        the element to be parsed
  * @return mixed                                            the object
  * @throws Throwable\Parse\Exception                        indicates that a problem occurred
  *                                                          when parsing
  */
 public function getObjectFromElement(\SimpleXMLElement $element)
 {
     $key = array($this->getElementName($element), $this->getElementNamespace($element));
     if (!$this->registry->hasKey($key)) {
         throw new Throwable\Parse\Exception('Unable to parse Spring XML. Element has not been registered.', array(':name' => $this->getElementPrefixedName($element)));
     }
     $factory = $this->registry->getValue($key);
     return $factory->getObject($this, $element);
 }