Hi again,

> Attached is a small patch for phd which supresses a warning with
> invalid xml files and tells you explicitely when an id is missing
> instead of throwing notices.

Err, wrong file. Here is the real patch.

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-= Geeking around in the name of science since 1982 =-
--- /home/cweiske/Dev/cvs/pear/instpear/share/pear/phd/themes/pear/peartheme.php.orig	2008-10-02 22:31:59.000000000 +0200
+++ /home/cweiske/Dev/cvs/pear/instpear/share/pear/phd/themes/pear/peartheme.php	2008-10-02 22:37:33.000000000 +0200
@@ -214,6 +214,7 @@
     }
 
     public function format_chunk($open, $name, $attrs, $props) {
+        $id = null;
         if (isset($attrs[PhDReader::XMLNS_XML]["id"])) {
             $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"];
         }
@@ -277,6 +278,9 @@
     }
     
     public function format_root_chunk($open, $name, $attrs, $props) {
+        if (!array_key_exists('id', $attrs[PhDReader::XMLNS_XML])) {
+            trigger_error('No xml:id attribute found in tag ' . $name, E_USER_ERROR);
+        }
         $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"];
         if ($open) {
             return "<div class=\"{$name}\">";

Attachment: signature.asc
Description: PGP signature

Reply via email to