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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 12:01:27 2024 UTC