[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-bugs
Subject:    [DOC-BUGS] #44247 [NEW]: qandaset related error
From:       "philip () php ! net" <doc-bugs () lists ! php ! net>
Date:       2008-02-25 17:07:54
Message-ID: bug-44247 () bugs ! php ! net
[Download RAW message or body]

From:             philip@php.net
Operating system: Mac
PHP version:      Irrelevant
PHP Bug Type:     Doc Build problem
Bug description:  qandaset related error

Description:
------------
Building via PhD (CVS-FEB25-2008) produces some libxml related errors,
although it still builds. The full output can be found in this pastebin:

  http://pastebin.ca/917717

Partial output will be attached to this bug report. The above pastebin
should be around for about a year. 

Note: The FAQ, that uses <qandaset>, appears to build fine.



Reproduce code:
---------------
$ cd /cvs/phpdoc
$ php configure.php
$ phd -d .manual.xml

The code in question:

/* FIXME: This function is a crazy performance killer */
public function qandaset($stream) {
    $xml = stream_get_contents($stream);

    $old = libxml_use_internal_errors(true);
    $doc = new DOMDocument("1.0", "UTF-8");
    $doc->preserveWhitespace = false;
    $doc->loadXML(html_entity_decode(str_replace("&", "&amp;amp;",
"<div>$xml</div>"), ENT_QUOTES, "UTF-8"));
    if ($err = libxml_get_errors()) {
        print_r($err);
        libxml_clear_errors();
    }
    fclose($stream);
    libxml_use_internal_errors($old);

    $xpath = new DOMXPath($doc);
    $nlist = $xpath->query("//div/dl/dt");
    $ret = '<div class="qandaset"><ol class="qandaset_questions">';
    $i = 0;
    foreach($nlist as $node) {
        $ret .= '<li><a href="#' .($this->cchunk["qandaentry"][$i++]).
'">' .($node->textContent). '</a></li>';
    }

    return $ret.'</ul>'.$xml.'</div>';
}

Actual result:
--------------
Partial result:

Array
(
    [0] => LibXMLError Object
        (
            [level] => 3
            [code] => 68
            [column] => 0
            [message] => StartTag: invalid element name

            [file] => 
            [line] => 223
        )

)
PHP Warning:  DOMXPath::query(): Invalid or inclomplete context in
/usr/local/lib/php/phd/themes/php/phpdotnet.php on line 533

Warning: DOMXPath::query(): Invalid or inclomplete context in
/usr/local/lib/php/phd/themes/php/phpdotnet.php on line 533
PHP Warning:  Invalid argument supplied for foreach() in
/usr/local/lib/php/phd/themes/php/phpdotnet.php on line 536

Warning: Invalid argument supplied for foreach() in
/usr/local/lib/php/phd/themes/php/phpdotnet.php on line 536

-- 
Edit bug report at http://bugs.php.net/?id=44247&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44247&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44247&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44247&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44247&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=44247&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44247&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44247&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44247&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44247&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44247&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=44247&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=44247&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44247&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44247&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44247&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44247&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44247&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44247&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44247&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44247&r=mysqlcfg

-- 
PHP Documentation Bugs Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic