Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #5591 Undefined variable notice when parsing DOCTYPE
Submitted: 2005-10-03 15:55 UTC
From: olivierg Assigned: ashnazg
Status: No Feedback Package: XML_Beautifier
PHP Version: 4.3.10 OS: Linux Debian
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-03 15:55 UTC] olivierg
Description: ------------ Hi, I'm using version 1.1 The test script below issues : "Notice: Undefined index: data in /usr/share/php/XML/Beautifier/Tokenizer.php on line 235" Here's the xml file : http://www.samalyse.com/ln/0015.php Apart from that it seems to be properly beautified. Test script: --------------- error_reporting (E_ALL); require_once ('XML/Beautifier.php'); $fmt = new XML_Beautifier(); echo $fmt->formatString (file_get_contents('xb_notice.xml'));

Comments

 [2005-10-03 18:27 UTC] schst
The link does not produce any useful output.
 [2005-10-04 11:05 UTC] olivierg
Just right click on the "Download" link, and try to beautify this with the test script.
 [2005-10-04 11:09 UTC] schst
The page only displays: Can't connect to : $! There is no XML.
 [2005-10-04 11:53 UTC] olivierg
I could not see this behaviour from my local machine, I tested from a remote one, that's a weird bug... It should be fixed now. Sorry about this. The reason why I use this '/ln/*' sort of link is because in my previous bug reports, long urls often got broken in 2 lines.
 [2006-10-01 19:47 UTC] arnaud (Arnaud Limbourg)
Until the package gets a new maintainer.
 [2008-09-19 21:46 UTC] ashnazg (Chuck Burgess)
The massive amount of data on that URL seems a lot just to be a test case to duplicate that Notice. When I attempt to process that HTML code using current versions of things, I only get XML_Parser errors. If the issue is truly with the DOCTYPE piece, I can say that a trimmed-down version that URL's HTML seems to process fine for me, with no Notice. I removed everything between BODY's first DIV and the end of BODY, but left everything else intact. Is there any chance you can reverify this issue from your end?
 [2008-09-22 21:09 UTC] ashnazg (Chuck Burgess)
I should mention that my test was fine via both PHP 4.4.9 and 5.2.4 (aside from the XML and DOCTYPE tags being stripped in 5.2.4 as per Bug #5450).
 [2008-09-22 22:01 UTC] olivierg (Olivier Guilyardi)
This bug still occur under PHP 4.4.4 and XML_Beautifier 1.2.0. But it works ok under PHP 5.2.0 First, the XML contained in xb_notice.txt is 100% valid. You can check that out for example with libxml2's xmllint utility: xmllint --valid --noout xb_notice.txt But XML_Beautifier fails to parse it because it does not fetch the external DTD, and complains about undefined entities. I don't know if this is expected, but it is anyway out of the scope of this bug. To reproduce this bug, just remove all entities with something like: sed -i 's/&[^;]*;//' xb_notice.txt Then run the test script (see my original report). On my side it says: Notice: Undefined index: data in /usr/share/php/XML/Beautifier/Tokenizer.php on line 288 The line changed, but it's still exactly the same bug...
 [2009-01-01 14:27 UTC] doconnor (Daniel O'Connor)
Oliver, want to upgrade to 4.4.9 and give it another shot? Otherwise its pretty much a works-for-me as per Chuck's comments.