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

Bug #807 reliance on XML_Parser means undefined entities bork parsing
Submitted: 2004-02-20 03:30 UTC
From: cellog Assigned:
Status: Wont fix Package: XML_Beautifier
PHP Version: Irrelevant OS: na
Roadmaps: (Not assigned)    

 [2004-02-20 03:30 UTC] cellog
Description: ------------ I'm not sure what a good solution is, but this code cannot be beautified, and fails: $a = '<stuff>&unknown;</stuff>'; $beaut = new XML_Beautifier; var_dump($beaut->formatString($a)); Basically, the xml_parse() function cannot work on any xml that has unresolved entities, such as a single file from peardoc. I was hoping the peardoc2 converter from phpDocumentor could beautify output to make the lives of translators easier, but this will now mean bundling the global.ent file with phpDocumentor, something I'd hate to have to do. I'm going to write in a hack for now, but please let me know if there is any possible solution that would involve a modification to XML_Beautifier, since you don't really need the anal-retentiveness of xml_parse() anyway in order to tokenize and spit back out the xml. thanks, Greg


 [2004-03-12 16:15 UTC] schst
I developed XML_Parser to beautify valid XML files, but the Tokenizer is split from the renderer, so if someone is interested on writign a new tokenizer feel free to do it. I'm not sure I will have to time to do this... A fast, but not really elegant solution could be using a preg_replace to replace the entities by <![CDATA &ent, ]]>. Stephan
 [2004-06-22 16:36 UTC] mike
Please mark this as "Won't fix" if you won't fix this issue - or maybe "suspended" if you feel that you'll implement it, though. Thanks
 [2004-06-22 17:02 UTC] schst
This will be changed as soon as I've got enough time to include Greg's Parser (or if he has time to do this)
 [2009-05-30 08:21 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Wont fix -Roadmap Versions: 1.2.1 +Roadmap Versions: