public function parse($asxml = false)
    {
        $xml = new stdClass();

        // Error messages to XML
        if (isset($_SESSION['messages']) && !empty($_SESSION['messages'])) {
            $xml->messages = $_SESSION['messages'];
            unset($_SESSION['messages']);
        }

        // Page requisites
        foreach ($this->requisites as $k => $v) {
            if (is_array($v)) {
                $v = array_unique($v);
            }

            $xml->{$k} = $v;
        }

        // Properties
        foreach ($this->properties as $k => $v) {
            if (!empty($v)) {
                $xml->$k = $v;
            }
        }

        $this->addObject($xml, false, 'common');

        // Return parsed XHTML
        $module = $this->dom->createElement('module');
        $module->appendChild($this->page);
        $this->dom->firstChild->appendChild($module);

        if (error_reporting() === E_ALL) {
            Debug::__print(htmlspecialchars($this->toString()));
        }

        try {
            $retval = $this->asxml ? $this->toString() : $this->xsl->parse($this->dom);
        } catch (Exception $e) {
            Debug::__print($e->getMessage());
            $retval = false;
        }

        return $retval;
    }
public function parse($asxml = false)
    {
        $xml = new stdClass();

        // Error messages to XML
        if (isset($_SESSION['messages']) && !empty($_SESSION['messages'])) {
            $xml->messages = $_SESSION['messages'];
            unset($_SESSION['messages']);
        }

        // Page requisites
        foreach ($this->requisites as $k => $v) {
            if (is_array($v)) {
                $v = array_unique($v);
            }

            $xml->{$k} = $v;
        }

        // Properties
        foreach ($this->properties as $k => $v) {
            if (!empty($v)) {
                $xml->$k = $v;
            }
        }

        $this->addObject($xml, false, 'common');

        // Return parsed XHTML
        $module = $this->dom->createElement('module');
        $module->appendChild($this->page);
        $this->dom->firstChild->appendChild($module);

        if (error_reporting() === E_ALL) {
            Debug::__print(htmlspecialchars($this->toString()));
        }

        try {
            $retval = $this->asxml ? $this->toString() : $this->xsl->parse($this->dom);
        } catch (Exception $e) {
            Debug::__print($e->getMessage());
            $retval = false;
        }

        return $retval;
    }
public function parse ( $ asxml = false ) { $ xml = new stdClass ( ) ; // Error messages to XML if ( isset ( $ _SESSION [ 'messages' ] ) && ! empty ( $ _SESSION [ 'messages' ] ) ) { $ xml -> messages = $ _SESSION [ 'messages' ] ; unset ( $ _SESSION [ 'messages' ] ) ; } // Page requisites foreach ( $ this -> requisites as $ k => $ v ) { if ( is_array ( $ v ) ) { $ v = array_unique ( $ v ) ; } $ xml -> { $ k } = $ v ; } // Properties foreach ( $ this -> properties as $ k => $ v ) { if ( ! empty ( $ v ) ) { $ xml -> $ k = $ v ; } } $ this -> addObject ( $ xml , false , 'common' ) ; // Return parsed XHTML $ module = $ this -> dom -> createElement ( 'module' ) ; $ module -> appendChild ( $ this -> page ) ; $ this -> dom -> firstChild -> appendChild ( $ module ) ; if ( error_reporting ( ) === E_ALL ) { Debug :: __print ( htmlspecialchars ( $ this -> toString ( ) ) ) ; } try { $ retval = $ this -> asxml ? $ this -> toString ( ) : $ this -> xsl -> parse ( $ this -> dom ) ; } catch ( Exception $ e ) { Debug :: __print ( $ e -> getMessage ( ) ) ; $ retval = false ; } return $ retval ; }
Adds common XML data and returns XSL parser output.

@param bool $asxml If true, return value will be XML
@uses   Xml_Read
@return mixed
Adds common XML data and returns XSL parser output .