public function unmarshal($xml)
    {
        // Get all namespaces
        $this->dom = new \DOMDocument();
        if ($this->debug) {
            $this->dom->formatOutput = true;
        }
        $this->dom->loadXML($xml);

        $this->namespaces =  $this->getDocNamespaces($this->dom);

        // Find targetNamespace

        $xpath = new \DOMXPath($this->dom);
        $query = ".";
        $root = $xpath->query($query);
        $ns = $code = "";
        foreach ($root as $rt) {
            list($ns, $name) = $this->parseQName($rt->nodeName, true);
        }

        $className = $this->urnToPhpName($ns)."\\".$this->classPrefix.$name;

        if (!class_exists($className, CoreConstants::USE_AUTOLOADER)) {
            throw new \RuntimeException('Class '.$className. ' is not found. Make sure it was included');
        }

        $binding = new $className();

        return $this->bindXml($xml, $binding);

        // Instantiate class
        // Assign corresponding nodes to properties/classes
        // return PHP binding
    }
public function unmarshal($xml)
    {
        // Get all namespaces
        $this->dom = new \DOMDocument();
        if ($this->debug) {
            $this->dom->formatOutput = true;
        }
        $this->dom->loadXML($xml);

        $this->namespaces =  $this->getDocNamespaces($this->dom);

        // Find targetNamespace

        $xpath = new \DOMXPath($this->dom);
        $query = ".";
        $root = $xpath->query($query);
        $ns = $code = "";
        foreach ($root as $rt) {
            list($ns, $name) = $this->parseQName($rt->nodeName, true);
        }

        $className = $this->urnToPhpName($ns)."\\".$this->classPrefix.$name;

        if (!class_exists($className, CoreConstants::USE_AUTOLOADER)) {
            throw new \RuntimeException('Class '.$className. ' is not found. Make sure it was included');
        }

        $binding = new $className();

        return $this->bindXml($xml, $binding);

        // Instantiate class
        // Assign corresponding nodes to properties/classes
        // return PHP binding
    }
public function unmarshal ( $ xml ) { // Get all namespaces $ this -> dom = new \ DOMDocument ( ) ; if ( $ this -> debug ) { $ this -> dom -> formatOutput = true ; } $ this -> dom -> loadXML ( $ xml ) ; $ this -> namespaces = $ this -> getDocNamespaces ( $ this -> dom ) ; // Find targetNamespace $ xpath = new \ DOMXPath ( $ this -> dom ) ; $ query = "." ; $ root = $ xpath -> query ( $ query ) ; $ ns = $ code = "" ; foreach ( $ root as $ rt ) { list ( $ ns , $ name ) = $ this -> parseQName ( $ rt -> nodeName , true ) ; } $ className = $ this -> urnToPhpName ( $ ns ) . "\\" . $ this -> classPrefix . $ name ; if ( ! class_exists ( $ className , CoreConstants :: USE_AUTOLOADER ) ) { throw new \ RuntimeException ( 'Class ' . $ className . ' is not found. Make sure it was included' ) ; } $ binding = new $ className ( ) ; return $ this -> bindXml ( $ xml , $ binding ) ; // Instantiate class // Assign corresponding nodes to properties/classes // return PHP binding }
Unmarshal XML string to corresponding PHP binding

@param string $xml XML string to unmarshal

@return object PHP binding object
Unmarshal XML string to corresponding PHP binding