Edward Z. Yang wrote:
> PHPDoc uses the same setup [snip]

My apologies if I've wasted anyone's time (that's a really long email).
It boils down to this: extra code after $dom->load():

// Experimental: separate out DTD to help out external lint programs
$set = $dom->doctype->internalSubset;
$dtd = substr($set, $l = strpos($set, '[') + 1, strrpos($set, ']>') - $l);
$dtd .= file_get_contents($ac['srcdir'] .
'/docbook/docbook-xml/docbook.dtd');
file_put_contents('phpdoc.dtd', $dtd);

Unfortunately, the suggested xmllint --dtdvalid doesn't seem to work
because libxml loads up the DTD too late; we need it for parsing. The
proper solution seems to inject the DOCTYPE into a temporary version of
the XML file and lint that. I'll whip out a script for that soon.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

Reply via email to