src/lib/Phine/Compact/Exception/XmlException.php
public function createUsingLastXmlError()
    {
        $errors = array();
        $count = 0;

        /** @var \libXMLError $error */
        foreach (libxml_get_errors() as $error) {
            $errors[] = sprintf(
                '#%d.) "%s" in %s line %d column %d.',
                ++$count,
                trim($error->message),
                $error->file,
                $error->line,
                $error->column
            );
        }

        $this->finish();

        if (empty($errors)) {
            $errors[] = '(unknown error)';
        }

        return new self(join("\n", $errors));
    }
public function createUsingLastXmlError()
    {
        $errors = array();
        $count = 0;

        /** @var \libXMLError $error */
        foreach (libxml_get_errors() as $error) {
            $errors[] = sprintf(
                '#%d.) "%s" in %s line %d column %d.',
                ++$count,
                trim($error->message),
                $error->file,
                $error->line,
                $error->column
            );
        }

        $this->finish();

        if (empty($errors)) {
            $errors[] = '(unknown error)';
        }

        return new self(join("\n", $errors));
    }
public function createUsingLastXmlError ( ) { $ errors = array ( ) ; $ count = 0 ; /** @var \libXMLError $error */ foreach ( libxml_get_errors ( ) as $ error ) { $ errors [ ] = sprintf ( '#%d.) "%s" in %s line %d column %d.' , ++ $ count , trim ( $ error -> message ) , $ error -> file , $ error -> line , $ error -> column ) ; } $ this -> finish ( ) ; if ( empty ( $ errors ) ) { $ errors [ ] = '(unknown error)' ; } return new self ( join ( "\n" , $ errors ) ) ; }
Creates a new exception using the most recent libxml errors.

This method will create a new exception using all of th error messages
in the libxml error buffer. The message will contain each error message,
along with the affected file name, line number, and column number.

throw XmlException::createUsingLastXmlError();

@return XmlException The new exception.
Creates a new exception using the most recent libxml errors .