php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44247 qandaset related error
Submitted: 2008-02-25 17:07 UTC Modified: 2008-03-03 12:32 UTC
From: philip@php.net Assigned: bjori (profile)
Status: Closed Package: Doc Build problem
PHP Version: Irrelevant OS: Mac
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: philip@php.net
New email:
PHP Version: OS:

 

 [2008-02-25 17:07 UTC] philip@php.net
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-02 11:47 UTC] bjori@php.net
This bug has been fixed in CVS. Since the websites are not directly
updated from the CVS server, the fix might need some time to spread
across the globe to all mirror sites, including PHP.net itself.

Thank you for the report, and for helping us make PHP.net better.


 [2008-03-03 11:50 UTC] bjori@php.net
Re-open.
The <qandset /> is producing mismatching opening and closing tags.
 [2008-03-03 12:32 UTC] bjori@php.net
This bug has been fixed in CVS. Since the websites are not directly
updated from the CVS server, the fix might need some time to spread
across the globe to all mirror sites, including PHP.net itself.

Thank you for the report, and for helping us make PHP.net better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 05:01:27 2024 UTC