protected function parseOutline(SimpleXMLElement $outlineXML)
    {
        $outline = [];
        foreach ($outlineXML->attributes() as $key => $value) {
            $outline[$key] = (string)$value;
        }
        // Bug fix for OPMLs witch contains `title` but not the required `text`
        if (empty($outline['text']) && isset($outline['title'])) {
            $outline['text'] = $outline['title'];
        }
        foreach ($outlineXML->children() as $key => $value) {
            // An outline may contain any number of outline children
            if ($key === 'outline') {
                $outline['@outlines'][] = $this->parseOutline($value);
            }
        }
        return $outline;
    }
protected function parseOutline(SimpleXMLElement $outlineXML)
    {
        $outline = [];
        foreach ($outlineXML->attributes() as $key => $value) {
            $outline[$key] = (string)$value;
        }
        // Bug fix for OPMLs witch contains `title` but not the required `text`
        if (empty($outline['text']) && isset($outline['title'])) {
            $outline['text'] = $outline['title'];
        }
        foreach ($outlineXML->children() as $key => $value) {
            // An outline may contain any number of outline children
            if ($key === 'outline') {
                $outline['@outlines'][] = $this->parseOutline($value);
            }
        }
        return $outline;
    }
protected function parseOutline ( SimpleXMLElement $ outlineXML ) { $ outline = [ ] ; foreach ( $ outlineXML -> attributes ( ) as $ key => $ value ) { $ outline [ $ key ] = ( string ) $ value ; } // Bug fix for OPMLs witch contains `title` but not the required `text` if ( empty ( $ outline [ 'text' ] ) && isset ( $ outline [ 'title' ] ) ) { $ outline [ 'text' ] = $ outline [ 'title' ] ; } foreach ( $ outlineXML -> children ( ) as $ key => $ value ) { // An outline may contain any number of outline children if ( $ key === 'outline' ) { $ outline [ '@outlines' ] [ ] = $ this -> parseOutline ( $ value ) ; } } return $ outline ; }
Parse an XML object as an outline object and return corresponding array

@param SimpleXMLElement $outlineXML the XML object we want to parse
@return array corresponding to an outline and following format described above
Parse an XML object as an outline object and return corresponding array