Weird PhD optimizations (10% !)
| From: | Hannes Magnusson | Date: | Wed, 25 May 2011 09:50:41 +0000 |
| Subject: | Weird PhD optimizations (10% !) | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969382704@lists.php.net to get a copy of this message | ||
Hi all
I'm still looking at ways to optimize PhD..
By remove all the class constant lookups we can shave off 9-10%..
Thats 8-9 seconds on my laptop (for a full build).
It does however make the code slightly weirder to read, so I'm
wondering if you guys think its worth it?
I did add comments to Reader.php explaining what those seemingly
random numbers mean.. and the other constants we use are for the
namespace declarations...
See the attached patch.
-Hannes
Index: phpdotnet/phd/Format/Abstract/XHTML.php =================================================================== --- phpdotnet/phd/Format/Abstract/XHTML.php (revision 311392) +++ phpdotnet/phd/Format/Abstract/XHTML.php (working copy) @@ -20,8 +20,8 @@ public function transformFromMap($open, $tag, $name, $attrs, $props) { if ($open) { $idstr = ""; - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $idstr = ' id="' .$id. '"'; } return '<' .$tag. ' class="' .$name. '"' . $idstr . ($props["empty"] ? '/' : "") . '>'; Index: phpdotnet/phd/Package/IDE/Base.php =================================================================== --- phpdotnet/phd/Package/IDE/Base.php (revision 311392) +++ phpdotnet/phd/Package/IDE/Base.php (working copy) @@ -211,7 +211,7 @@ } public function format_set($open, $name, $attrs, $props) { - if (isset($attrs[Reader::XMLNS_XML]['id']) && $attrs[Reader::XMLNS_XML]['id'] == 'funcref') { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id']) && $attrs["http://www.w3.org/XML/1998/namespace"]['id'] == 'funcref') { $this->isFunctionRefSet = $open; } } @@ -224,7 +224,7 @@ $this->function = $this->dfunction; $this->cchunk = $this->dchunk; - $this->function['manualid'] = $attrs[Reader::XMLNS_XML]['id']; + $this->function['manualid'] = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; return; } $this->writeChunk(); @@ -247,8 +247,8 @@ return; } if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role']) && $attrs[Reader::XMLNS_DOCBOOK]['role']) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]['role']; + if (isset($attrs["http://docbook.org/ns/docbook"]['role']) && $attrs["http://docbook.org/ns/docbook"]['role']) { + $this->role = $attrs["http://docbook.org/ns/docbook"]['role']; } else { $this->role = false; } @@ -281,7 +281,7 @@ } if ($open) { $this->cchunk['methodparam'] = true; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['choice']) && $attrs[Reader::XMLNS_DOCBOOK]['choice'] == 'opt') { + if (isset($attrs["http://docbook.org/ns/docbook"]['choice']) && $attrs["http://docbook.org/ns/docbook"]['choice'] == 'opt') { $this->cchunk['param']['opt'] = 'true'; } else { $this->cchunk['param']['opt'] = 'false'; Index: phpdotnet/phd/Package/IDE/Funclist.php =================================================================== --- phpdotnet/phd/Package/IDE/Funclist.php (revision 311392) +++ phpdotnet/phd/Package/IDE/Funclist.php (working copy) @@ -49,7 +49,7 @@ } public function format_set($open, $name, $attrs, $props) { - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $attrs[Reader::XMLNS_XML]["id"] == "funcref") { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $attrs["http://www.w3.org/XML/1998/namespace"]["id"] == "funcref") { $this->isFunctionRefSet = $open; } return ""; Index: phpdotnet/phd/Package/PEAR/XHTML.php =================================================================== --- phpdotnet/phd/Package/PEAR/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/PEAR/XHTML.php (working copy) @@ -463,8 +463,8 @@ $content = $fragment = ''; $class = $name; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['linkend'])) { - $linkto = $attrs[Reader::XMLNS_DOCBOOK]['linkend']; + if (isset($attrs["http://docbook.org/ns/docbook"]['linkend'])) { + $linkto = $attrs["http://docbook.org/ns/docbook"]['linkend']; $id = $href = Format::getFilename($linkto); if ($id != $linkto) { @@ -518,8 +518,8 @@ { if ($open) { $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $idstr = ' id="' . $id . '"'; } return '<' .$tag. ' class="' .$name. '"' . $idstr. '>' . ($props['empty'] ? "</{$tag}>" : ''); @@ -548,9 +548,9 @@ } $text = $props['empty'] ? '' : $this->phd_pearapi_text; - $package = $attrs[Reader::XMLNS_PHD]['package']; - $linkend = isset($attrs[Reader::XMLNS_PHD]['linkend']) - ? $attrs[Reader::XMLNS_PHD]['linkend'] : null; + $package = $attrs["http://www.php.net/ns/phd"]['package']; + $linkend = isset($attrs["http://www.php.net/ns/phd"]['linkend']) + ? $attrs["http://www.php.net/ns/phd"]['linkend'] : null; $arLinkend = explode('::', $linkend); $class = null; $method = null; @@ -613,8 +613,8 @@ { if ($open) { $this->trim = true; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role'])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]['role']; + if (isset($attrs["http://docbook.org/ns/docbook"]['role'])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]['role']; } else { $this->role = ''; } @@ -802,7 +802,7 @@ public function format_th_entry($open, $name, $attrs, $props) { if ($open) { - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); return '<th colspan="' .((int)$colspan). '">'; } return '</th>'; @@ -960,7 +960,7 @@ public function format_emphasis($open, $name, $attrs) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role']) && $attrs[Reader::XMLNS_DOCBOOK]['role'] == "bold") + if (isset($attrs["http://docbook.org/ns/docbook"]['role']) && $attrs["http://docbook.org/ns/docbook"]['role'] == "bold") $role = "b"; else $role = "i"; if ($open) { @@ -997,7 +997,7 @@ public function format_callout($open, $name, $attrs) { if ($open) { - return '<tr><td><a href="#'.$attrs[Reader::XMLNS_DOCBOOK]['arearefs'].'">(' .++$this->cchunk['callouts']. ')</a></td><td>'; + return '<tr><td><a href="#'.$attrs["http://docbook.org/ns/docbook"]['arearefs'].'">(' .++$this->cchunk['callouts']. ')</a></td><td>'; } return "</td></tr>\n"; } @@ -1037,7 +1037,7 @@ */ public function format_root_chunk($open, $name, $attrs, $props) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; if ($open) { $this->notify(Render::CHUNK, Render::OPEN); return "<div class=\"{$name}\">"; @@ -1046,8 +1046,8 @@ $content = $this->createTOC( $id, $name, $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1 + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1 ); $content .= "</div>\n"; @@ -1058,12 +1058,12 @@ public function format_chunk($open, $name, $attrs, $props) { $id = null; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; } - $isChunk = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true" : true; + $isChunk = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true" : true; if ($isChunk) { $this->cchunk = $this->dchunk; @@ -1075,8 +1075,8 @@ $this->lang = $props['lang']; } if ($name == 'refentry') { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role'])) { - $this->cchunk['verinfo'] = !($attrs[Reader::XMLNS_DOCBOOK]['role'] == 'noversion'); + if (isset($attrs["http://docbook.org/ns/docbook"]['role'])) { + $this->cchunk['verinfo'] = !($attrs["http://docbook.org/ns/docbook"]['role'] == 'noversion'); } else { $this->cchunk['verinfo'] = true; } @@ -1092,17 +1092,17 @@ public function format_container_chunk($open, $name, $attrs, $props) { - if (!isset($attrs[Reader::XMLNS_XML]['id'])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { if ($open) { return "<div class=\"{$name}\">"; } else { return "</div>\n"; } } - $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; - $isChunk = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true": true; + $isChunk = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true": true; if ($isChunk) { $this->cchunk = $this->dchunk; @@ -1116,8 +1116,8 @@ $toc = $this->createTOC( $id, $name, $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1 + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1 ); if ($toc) { Index: phpdotnet/phd/Package/PEAR/CHM.php =================================================================== --- phpdotnet/phd/Package/PEAR/CHM.php (revision 311392) +++ phpdotnet/phd/Package/PEAR/CHM.php (working copy) @@ -383,8 +383,8 @@ } private function collectContent($attrs) { - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $this->isChunkID($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $this->isChunkID($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->lastContent = array( "name" => Format::getShortDescription($id), "reference" => "res\\" . Index: phpdotnet/phd/Package/PHP/BigPDF.php =================================================================== --- phpdotnet/phd/Package/PHP/BigPDF.php (revision 311392) +++ phpdotnet/phd/Package/PHP/BigPDF.php (working copy) @@ -42,9 +42,9 @@ } parent::setPdfDoc($pdfDoc); - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) parent::setChunkInfo("xml-base", $base); - $id = $attrs[Reader::XMLNS_XML]["id"]; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(Format::getShortDescription($id), null, true); $this->setIdToPage($id); Index: phpdotnet/phd/Package/PHP/Epub.php =================================================================== --- phpdotnet/phd/Package/PHP/Epub.php (revision 311392) +++ phpdotnet/phd/Package/PHP/Epub.php (working copy) @@ -302,8 +302,8 @@ } protected function collectContent($attrs, $class, $child) { - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $this->lastContent = array( 'id' => $id, 'title' => $this->getShortDescription($id), Index: phpdotnet/phd/Package/PHP/XHTML.php =================================================================== --- phpdotnet/phd/Package/PHP/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/PHP/XHTML.php (working copy) @@ -218,7 +218,7 @@ $acronyms = array(); while ($r->read()) { - if ($r->nodeType != \XMLReader::ELEMENT) { + if ($r->nodeType != 1) { // 1 == XMLReader::ELEMENT continue; } if ($r->name == "term") { @@ -268,8 +268,8 @@ public function format_fieldsynopsis_varname($open, $name, $attrs) { if ($open) { $href = ""; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $linkto = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $linkto = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $href = Format::getFilename($linkto); if ($this->chunked) { @@ -294,7 +294,7 @@ } return ' <var class="'.$name.'">'.$href.'$'; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { return '</a></var>'; } return '</var>'; @@ -472,8 +472,8 @@ /*Chunk Functions*/ public function format_container_chunk($open, $name, $attrs, $props) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; - if (!isset($attrs[Reader::XMLNS_PHD]["chunk"]) || $attrs[Reader::XMLNS_PHD]["chunk"] == "true") { + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; + if (!isset($attrs["http://www.php.net/ns/phd"]["chunk"]) || $attrs["http://www.php.net/ns/phd"]["chunk"] == "true") { $this->cchunk = $this->dchunk; } @@ -520,7 +520,7 @@ } public function format_root_chunk($open, $name, $attrs) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; if ($open) { $this->notify(Render::CHUNK, Render::OPEN); return '<div id="'.$id.'" class="'.$name.'">'; @@ -561,8 +561,8 @@ public function format_chunk($open, $name, $attrs, $props) { if ($open) { - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid(); @@ -570,7 +570,7 @@ } $this->CURRENT_CHUNK = $this->CURRENT_ID = $id; - if (!isset($attrs[Reader::XMLNS_PHD]["chunk"]) || $attrs[Reader::XMLNS_PHD]["chunk"] == "true") { + if (!isset($attrs["http://www.php.net/ns/phd"]["chunk"]) || $attrs["http://www.php.net/ns/phd"]["chunk"] == "true") { $this->cchunk = $this->dchunk; $this->notify(Render::CHUNK, Render::OPEN); } @@ -578,8 +578,8 @@ $this->lang = $props["lang"]; } if ($name == "refentry") { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->cchunk["verinfo"] = !($attrs[Reader::XMLNS_DOCBOOK]["role"] == "noversion"); + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->cchunk["verinfo"] = !($attrs["http://docbook.org/ns/docbook"]["role"] == "noversion"); } else { $this->cchunk["verinfo"] = true; } Index: phpdotnet/phd/Package/PHP/CHM.php =================================================================== --- phpdotnet/phd/Package/PHP/CHM.php (revision 311392) +++ phpdotnet/phd/Package/PHP/CHM.php (working copy) @@ -417,8 +417,8 @@ } private function collectContent($attrs) { - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->lastContent = array( "name" => Format::getShortDescription($id), "reference" => "res" . DIRECTORY_SEPARATOR . Index: phpdotnet/phd/Package/PHP/KDevelop.php =================================================================== --- phpdotnet/phd/Package/PHP/KDevelop.php (revision 311392) +++ phpdotnet/phd/Package/PHP/KDevelop.php (working copy) @@ -123,8 +123,8 @@ } public function format_tocsect1($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $hasChild = (count(Format::getChildren($id)) > 0); if ($open) { $name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8'); @@ -138,8 +138,8 @@ } public function format_tocsect2($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $hasChild = (count(Format::getChildren($id)) > 0); if ($open) { $name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8'); @@ -150,8 +150,8 @@ } public function format_refentry($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; if ($open) { $this->currentEntryName = null; } Index: phpdotnet/phd/Package/PHP/PDF.php =================================================================== --- phpdotnet/phd/Package/PHP/PDF.php (revision 311392) +++ phpdotnet/phd/Package/PHP/PDF.php (working copy) @@ -155,10 +155,10 @@ v("PDF Compression failed, you need to compile libharu with Zlib...", E_USER_WARNING); } parent::setPdfDoc($pdfDoc); - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) parent::setChunkInfo("xml-base", $base); - $id = $attrs[Reader::XMLNS_XML]["id"]; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(Format::getShortDescription($id), null, true); $this->setIdToPage($id); @@ -192,11 +192,11 @@ } else { parent::getPdfDoc()->add(PdfWriter::LINE_JUMP); } - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) { parent::setChunkInfo("xml-base", $base); } - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $parentId = Format::getParent($id); if (isset($this->cchunk["id-to-outline"][$parentId])) { $this->cchunk["id-to-outline"][$id] = parent::getPdfDoc()->createOutline @@ -314,7 +314,7 @@ } public function format_collect_id($open, $name, $attrs, $props, $newpage = false) { - if ($open && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if ($open && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $this->setIdToPage($id); } return false; Index: phpdotnet/phd/Package/Generic/PDF.php =================================================================== --- phpdotnet/phd/Package/Generic/PDF.php (revision 311392) +++ phpdotnet/phd/Package/Generic/PDF.php (working copy) @@ -546,13 +546,13 @@ public function format_link($open, $name, $attrs, $props) { if ($open && ! $props["empty"]) { $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0, 0, 1)); // blue - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $this->cchunk["linkend"] = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $this->cchunk["linkend"] = $attrs["http://docbook.org/ns/docbook"]["linkend"]; } elseif(isset($attrs[Reader::XMLNS_XLINK]["href"])) { $this->cchunk["href"] = $attrs[Reader::XMLNS_XLINK]["href"]; } - } elseif ($open && $name == "xref" && isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"]) - && $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]) { + } elseif ($open && $name == "xref" && isset($attrs["http://docbook.org/ns/docbook"]["linkend"]) + && $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]) { $this->cchunk["linkend"] = $linkend; $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0, 0, 1)); // blue $this->format_link_text(Format::getShortDescription($linkend), $name); @@ -720,13 +720,13 @@ public function format_colspec($open, $name, $attrs) { if ($open) { - Format::colspec($attrs[Reader::XMLNS_DOCBOOK]); + Format::colspec($attrs["http://docbook.org/ns/docbook"]); } return ""; } public function format_thead($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); $this->pdfDoc->setFont(PdfWriter::FONT_BOLD); } else { $this->pdfDoc->revertFont(); @@ -735,14 +735,14 @@ } public function format_tbody($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); } return ""; } public function format_row($open, $name, $attrs) { if ($open) { Format::initRow(); - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); $colCount = Format::getColCount(); $this->pdfDoc->add(PdfWriter::TABLE_ROW, array($colCount, $valign)); } else { @@ -757,9 +757,9 @@ $this->pdfDoc->add(PdfWriter::TABLE_END_ENTRY); } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align); - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); $this->pdfDoc->add(PdfWriter::TABLE_ENTRY, array($colspan, 1, $align)); } else { $this->pdfDoc->add(PdfWriter::TABLE_END_ENTRY); @@ -774,7 +774,7 @@ return; } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align); $retval = ""; if (isset($dbattrs["colname"])) { @@ -804,9 +804,9 @@ public function format_tgroup($open, $name, $attrs, $props) { if ($open) { - Format::tgroup($attrs[Reader::XMLNS_DOCBOOK]); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["cols"])) - $this->pdfDoc->add(PdfWriter::TABLE, $attrs[Reader::XMLNS_DOCBOOK]["cols"]); + Format::tgroup($attrs["http://docbook.org/ns/docbook"]); + if (isset($attrs["http://docbook.org/ns/docbook"]["cols"])) + $this->pdfDoc->add(PdfWriter::TABLE, $attrs["http://docbook.org/ns/docbook"]["cols"]); } else { } return ""; @@ -856,7 +856,7 @@ public function format_methodparam_parameter($open, $name, $attrs, $props) { if ($props["empty"]) return ''; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { $this->pdfDoc->setFont(PdfWriter::FONT_VERBATIM, 10); $this->pdfDoc->appendText(" &$"); return ''; @@ -872,7 +872,7 @@ public function format_parameter($open, $name, $attrs, $props) { if ($props["empty"]) return ''; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { $this->pdfDoc->setFont(PdfWriter::FONT_VERBATIM_ITALIC, 10); $this->pdfDoc->appendText(" &"); return ''; @@ -890,7 +890,7 @@ if ($this->params["count"] == 0) { $content .= " ("; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt") { + if (isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt") { $this->params["opt"]++; $content .= " ["; } else if($this->params["opt"]) { @@ -916,7 +916,7 @@ public function format_classsynopsisinfo($open, $name, $attrs, $props) { $this->cchunk["classsynopsisinfo"] = $this->dchunk["classsynopsisinfo"]; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { $this->format_para($open, $name, $attrs, $props); $this->pdfDoc->appendText("/* "); return ''; @@ -924,7 +924,7 @@ return $this->format_para($open, $name, $attrs, $props); } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { $this->pdfDoc->appendText(" */"); return $this->format_para($open, $name, $attrs, $props); } @@ -987,7 +987,7 @@ // Footnotes & Callouts {{{ public function format_footnoteref($open, $name, $attrs, $props) { if ($open) { - $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $found = false; foreach($this->cchunk["footnote"] as $k => $note) { if ($note["id"] === $linkend) { @@ -1003,7 +1003,7 @@ public function format_footnote($open, $name, $attrs, $props) { if ($open) { $count = count($this->cchunk["footnote"]); - $noteid = isset($attrs[Reader::XMLNS_XML]["id"]) ? $attrs[Reader::XMLNS_XML]["id"] : $count + 1; + $noteid = isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? $attrs["http://www.w3.org/XML/1998/namespace"]["id"] : $count + 1; $note = array("id" => $noteid, "str" => ""); $this->cchunk["footnote"][$count] = $note; if ($this->cchunk["table"]) { @@ -1024,10 +1024,10 @@ } public function format_co($open, $name, $attrs, $props) { - if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if (($open || $props["empty"]) && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $co = ++$this->cchunk["co"]; $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0,0,1)); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkends"]) && $linkends = $attrs[Reader::XMLNS_DOCBOOK]["linkends"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["linkends"]) && $linkends = $attrs["http://docbook.org/ns/docbook"]["linkends"]) { $linkAreas = $this->pdfDoc->add(PdfWriter::LINK_ANNOTATION, "[{$co}]"); if (!isset($this->cchunk["links-to-resolve"][$linkends])) $this->cchunk["links-to-resolve"][$linkends] = array(); @@ -1055,7 +1055,7 @@ if ($open) { $co = ++$this->cchunk["co"]; $this->pdfDoc->setFont(PdfWriter::FONT_BOLD, 12, array(0,0,1)); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["arearefs"]) && $ref = $attrs[Reader::XMLNS_DOCBOOK]["arearefs"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["arearefs"]) && $ref = $attrs["http://docbook.org/ns/docbook"]["arearefs"]) { $linkAreas = $this->pdfDoc->add(PdfWriter::LINK_ANNOTATION, "[{$co}]"); if (!isset($this->cchunk["links-to-resolve"][$ref])) $this->cchunk["links-to-resolve"][$ref] = array(); @@ -1123,7 +1123,7 @@ public function format_imagedata($open, $name, $attrs, $props) { if ($props["empty"] && isset($this->cchunk["xml-base"]) && ($base = $this->cchunk["xml-base"]) && - isset($attrs[Reader::XMLNS_DOCBOOK]["fileref"]) && ($fileref = $attrs[Reader::XMLNS_DOCBOOK]["fileref"])) { + isset($attrs["http://docbook.org/ns/docbook"]["fileref"]) && ($fileref = $attrs["http://docbook.org/ns/docbook"]["fileref"])) { $imagePath = Config::xml_root() . DIRECTORY_SEPARATOR . $base . $fileref; if (file_exists($imagePath)) $this->pdfDoc->add(PdfWriter::IMAGE, $imagePath); Index: phpdotnet/phd/Package/Generic/TocFeed.php =================================================================== --- phpdotnet/phd/Package/Generic/TocFeed.php (revision 311392) +++ phpdotnet/phd/Package/Generic/TocFeed.php (working copy) @@ -312,20 +312,20 @@ return ''; } - if (isset($attrs[Reader::XMLNS_PHD]['chunk']) - && $attrs[Reader::XMLNS_PHD]['chunk'] == 'false' + if (isset($attrs["http://www.php.net/ns/phd"]['chunk']) + && $attrs["http://www.php.net/ns/phd"]['chunk'] == 'false' ) { //not chunked? no feed! return ''; } - if (!isset($attrs[Reader::XMLNS_XML]['id'])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { //if we do not have a hard id, then // we cannot link to the file. // So without an id, there is no atom file return ''; } - $id = $attrs[Reader::XMLNS_XML]['id']; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $this->writeChunk( $id, $this->createAtomToc($id) Index: phpdotnet/phd/Package/Generic/XHTML.php =================================================================== --- phpdotnet/phd/Package/Generic/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/Generic/XHTML.php (working copy) @@ -510,11 +510,11 @@ return '<div class="phd-toc">'; } return $this->createToc( - $attrs[Reader::XMLNS_PHD]['element'], + $attrs["http://www.php.net/ns/phd"]['element'], 'phd-toc', $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1, + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1, false ) . "</div>\n"; } @@ -595,8 +595,8 @@ if ($open) { $link = $class = $content = ""; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $link = $this->createLink($attrs[Reader::XMLNS_DOCBOOK]["linkend"]); + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $link = $this->createLink($attrs["http://docbook.org/ns/docbook"]["linkend"]); } elseif (isset($attrs[Reader::XMLNS_XLINK]["href"])) { $link = $attrs[Reader::XMLNS_XLINK]["href"]; @@ -615,7 +615,7 @@ public function format_xref($open, $name, $attrs, $props) { if ($open) { $desc = ""; - $link = $this->createLink($attrs[Reader::XMLNS_DOCBOOK]["linkend"], $desc); + $link = $this->createLink($attrs["http://docbook.org/ns/docbook"]["linkend"], $desc); $ret = '<a href="' .$link. '" class="' .$name. '">' .$desc; @@ -629,10 +629,10 @@ public function format_option($open, $name, $attrs) { if ($open) { - if(!isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $attrs[Reader::XMLNS_DOCBOOK]["role"] = "unknown"; + if(!isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $attrs["http://docbook.org/ns/docbook"]["role"] = "unknown"; } - $this->role = $role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + $this->role = $role = $attrs["http://docbook.org/ns/docbook"]["role"]; return '<strong class="' .$name.' ' .$role. '">'; } $this->role = null; @@ -641,8 +641,8 @@ public function format_literal($open, $name, $attrs) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -701,9 +701,9 @@ break; case "othername": - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { /* We might want to add support for other roles */ - switch($attrs[Reader::XMLNS_DOCBOOK]["role"]) { + switch($attrs["http://docbook.org/ns/docbook"]["role"]) { case "nickname": $class = " nickname"; break; @@ -720,8 +720,8 @@ public function format_container_chunk_top($open, $name, $attrs, $props) { $this->cchunk = $this->dchunk; $this->cchunk["name"] = $name; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid("phd"); } @@ -758,8 +758,8 @@ public function format_container_chunk_below($open, $name, $attrs, $props) { $this->cchunk = $this->dchunk; $this->cchunk["name"] = $name; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { /* FIXME: This will obviously not exist in the db.. */ $id = uniqid("phd"); @@ -769,7 +769,7 @@ $this->CURRENT_CHUNK = $id; $this->notify(Render::CHUNK, Render::OPEN); - return '<div id="' .$attrs[Reader::XMLNS_XML]["id"]. '" class="' .$name. '">'; + return '<div id="' .$attrs["http://www.w3.org/XML/1998/namespace"]["id"]. '" class="' .$name. '">'; } $toc = '<ol>'; @@ -788,7 +788,7 @@ } public function format_section_chunk($open, $name, $attrs, $props) { if ($open) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->isSectionChunk[] = false; return $this->transformFromMap($open, "div", $name, $attrs, $props); } @@ -803,8 +803,8 @@ public function format_chunk($open, $name, $attrs, $props) { if ($open) { $this->cchunk = $this->dchunk; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid("phd"); } @@ -851,13 +851,13 @@ } public function format_refsect($open, $name, $attrs) { if ($open) { - if(!isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $attrs[Reader::XMLNS_DOCBOOK]["role"] = "unknown"; + if(!isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $attrs["http://docbook.org/ns/docbook"]["role"] = "unknown"; } - $this->role = $role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + $this->role = $role = $attrs["http://docbook.org/ns/docbook"]["role"]; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["id"])) { - $id = $attrs[Reader::XMLNS_DOCBOOK]["id"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["id"])) { + $id = $attrs["http://docbook.org/ns/docbook"]["id"]; } else { $id = $name. "-" . $this->CURRENT_CHUNK . "-" . $role; @@ -893,13 +893,13 @@ public function format_classsynopsisinfo($open, $name, $attrs) { $this->cchunk["classsynopsisinfo"] = $this->dchunk["classsynopsisinfo"]; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { return '<div class="'.$name.' classsynopsisinfo_comment">/* '; } return '<div class="'.$name.'">'; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { return ' */</div>'; } $this->cchunk["classsynopsis"]["close"] = true; @@ -975,7 +975,7 @@ if ($props["empty"]) return; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { return ' <tt class="parameter reference">&$'; } return ' <tt class="parameter">$'; @@ -992,7 +992,7 @@ if ($props["empty"]) return; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { return '<i><tt class="parameter reference">&'; } return '<i><tt class="parameter">'; @@ -1013,7 +1013,7 @@ if ($this->params["count"] == 0) { $content .= " ("; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt") { + if (isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt") { $this->params["opt"]++; $content .= "["; } else if($this->params["opt"]) { @@ -1054,7 +1054,7 @@ public function format_footnoteref($open, $name, $attrs, $props) { if ($open) { - $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $found = false; foreach($this->cchunk["footnote"] as $k => $note) { if ($note["id"] === $linkend) { @@ -1068,7 +1068,7 @@ public function format_footnote($open, $name, $attrs, $props) { if ($open) { $count = count($this->cchunk["footnote"]); - $noteid = isset($attrs[Reader::XMLNS_XML]["id"]) ? $attrs[Reader::XMLNS_XML]["id"] : $count + 1; + $noteid = isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? $attrs["http://www.w3.org/XML/1998/namespace"]["id"] : $count + 1; $note = array("id" => $noteid, "str" => ""); $this->cchunk["footnote"][$count] = $note; if ($this->cchunk["table"]) { @@ -1109,9 +1109,9 @@ /* }}} */ public function format_co($open, $name, $attrs, $props) { - if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"])) { + if (($open || $props["empty"]) && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $co = ++$this->cchunk["co"]; - return '<a name="'.$attrs[Reader::XMLNS_XML]["id"].'" id="'.$attrs[Reader::XMLNS_XML]["id"].'">' .str_repeat("*", $co) .'</a>'; + return '<a name="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"].'" id="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"].'">' .str_repeat("*", $co) .'</a>'; } /* Suppress closing tag if any */ return ""; @@ -1125,7 +1125,7 @@ } public function format_callout($open, $name, $attrs) { if ($open) { - return '<tr><td><a href="#'.$attrs[Reader::XMLNS_DOCBOOK]["arearefs"].'">' .str_repeat("*", ++$this->cchunk["callouts"]). '</a></td><td>'; + return '<tr><td><a href="#'.$attrs["http://docbook.org/ns/docbook"]["arearefs"].'">' .str_repeat("*", ++$this->cchunk["callouts"]). '</a></td><td>'; } return "</td></tr>\n"; } @@ -1193,7 +1193,7 @@ } public function format_varlistentry($open, $name, $attrs) { if ($open) { - return isset($attrs[Reader::XMLNS_XML]["id"]) ? '<dt id="'.$attrs[Reader::XMLNS_XML]["id"]. '">' : "<dt>\n"; + return isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? '<dt id="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"]. '">' : "<dt>\n"; } return "</dt>\n"; } @@ -1226,7 +1226,7 @@ } public function format_systemitem($open, $name, $attrs) { if ($open) { - $val = isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) ? $attrs[Reader::XMLNS_DOCBOOK]["role"] : null; + $val = isset($attrs["http://docbook.org/ns/docbook"]["role"]) ? $attrs["http://docbook.org/ns/docbook"]["role"] : null; switch($val) { case "directive": /* FIXME: Different roles should probably be handled differently */ @@ -1244,8 +1244,8 @@ } public function format_programlisting($open, $name, $attrs) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -1347,11 +1347,11 @@ $this->cchunk["mediaobject"]["alt"] = $value; } public function format_imagedata($open, $name, $attrs) { - $file = $attrs[Reader::XMLNS_DOCBOOK]["fileref"]; + $file = $attrs["http://docbook.org/ns/docbook"]["fileref"]; if ($newpath = $this->mediamanager->handleFile($file)) { $curfile = $this->mediamanager->findFile($file); - $width = isset($attrs[Reader::XMLNS_DOCBOOK]["width"]) ? 'width="' . $attrs[Reader::XMLNS_DOCBOOK]["width"] . '"' : ''; - $height = isset($attrs[Reader::XMLNS_DOCBOOK]["depth"]) ? 'height="' . $attrs[Reader::XMLNS_DOCBOOK]["depth"] . '"' : ''; + $width = isset($attrs["http://docbook.org/ns/docbook"]["width"]) ? 'width="' . $attrs["http://docbook.org/ns/docbook"]["width"] . '"' : ''; + $height = isset($attrs["http://docbook.org/ns/docbook"]["depth"]) ? 'height="' . $attrs["http://docbook.org/ns/docbook"]["depth"] . '"' : ''; $alt = 'alt="' . ($this->cchunk["mediaobject"]["alt"] !== false ? $this->cchunk["mediaobject"]["alt"] : basename($file)) . '"'; // Generate height and width when none are supplied. @@ -1379,15 +1379,15 @@ if ($open) { $this->cchunk["table"] = true; $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $idstr = ' id="' . $attrs[Reader::XMLNS_XML]["id"] . '"'; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $idstr = ' id="' . $attrs["http://www.w3.org/XML/1998/namespace"]["id"] . '"'; } return '<table' . $idstr . ' class="doctable ' .$name. '">'; } $this->cchunk["table"] = false; $str = ""; if (isset($this->cchunk["tablefootnotes"]) && $this->cchunk["tablefootnotes"]) { - $opts = array(Reader::XMLNS_DOCBOOK => array()); + $opts = array("http://docbook.org/ns/docbook" => array()); $str = $this->format_tbody(true, "footnote", $opts, $props); $str .= $this->format_row(true, "footnote", $opts, $props); @@ -1410,7 +1410,7 @@ } public function format_tgroup($open, $name, $attrs) { if ($open) { - Format::tgroup($attrs[Reader::XMLNS_DOCBOOK]); + Format::tgroup($attrs["http://docbook.org/ns/docbook"]); return ''; } return ''; @@ -1433,7 +1433,7 @@ } public function format_colspec($open, $name, $attrs) { if ($open) { - $str = self::parse_table_entry_attributes(Format::colspec($attrs[Reader::XMLNS_DOCBOOK])); + $str = self::parse_table_entry_attributes(Format::colspec($attrs["http://docbook.org/ns/docbook"])); return '<col '.$str. ' />'; } @@ -1441,14 +1441,14 @@ } public function format_th($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<' .$name. ' valign="' .$valign. '">'; } return "</$name>\n"; } public function format_tbody($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<tbody valign="' .$valign. '" class="' .$name. '">'; } return "</tbody>"; @@ -1456,11 +1456,11 @@ public function format_row($open, $name, $attrs) { if ($open) { $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $idstr = ' id="'. $attrs[Reader::XMLNS_XML]['id']. '"'; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $idstr = ' id="'. $attrs["http://www.w3.org/XML/1998/namespace"]['id']. '"'; } Format::initRow(); - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<tr'.$idstr.' valign="' .$valign. '">'; } return "</tr>\n"; @@ -1470,7 +1470,7 @@ return '<th class="empty"> </th>'; } if ($open) { - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); if ($colspan == 1) { return '<th>'; } else { @@ -1484,7 +1484,7 @@ return '<td class="empty"> </td>'; } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $retval = ""; if (isset($dbattrs["colname"])) { @@ -1519,13 +1519,13 @@ $doc->appendChild($node); $xp = new \DOMXPath($doc); - $xp->registerNamespace("db", Reader::XMLNS_DOCBOOK); + $xp->registerNamespace("db", "http://docbook.org/ns/docbook"); $questions = $xp->query("//db:qandaentry/db:question"); $retval = '<div class="qandaset"><ol class="qandaset_questions">'; foreach($questions as $node) { - $id = $xp->evaluate("ancestor::db:qandaentry", $node)->item(0)->getAttributeNs(Reader::XMLNS_XML, "id"); + $id = $xp->evaluate("ancestor::db:qandaentry", $node)->item(0)->getAttributeNs("http://www.w3.org/XML/1998/namespace", "id"); /* FIXME: No ID? How can we create an anchor for it then? */ if (!$id) { @@ -1546,7 +1546,7 @@ } public function format_phd_question($open, $name, $attrs, $props) { if ($open) { - $href = $this->createLink($attrs[Reader::XMLNS_XML]["id"]); + $href = $this->createLink($attrs["http://www.w3.org/XML/1998/namespace"]["id"]); return '<li><a href="' .$href. '">'; } return '</a></li>'; @@ -1654,8 +1654,8 @@ public function format_orderedlist($open, $name, $attrs, $props) { if ($open) { $numeration = "1"; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["numeration"])) { - switch($attrs[Reader::XMLNS_DOCBOOK]["numeration"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["numeration"])) { + switch($attrs["http://docbook.org/ns/docbook"]["numeration"]) { case "upperalpha": $numeration = "A"; break; Index: phpdotnet/phd/Package/Generic/Manpage.php =================================================================== --- phpdotnet/phd/Package/Generic/Manpage.php (revision 311392) +++ phpdotnet/phd/Package/Generic/Manpage.php (working copy) @@ -539,8 +539,8 @@ public function format_methodparam($open, $name, $attrs, $props) { if ($open) { - $opt = isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && - $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt"; + $opt = isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && + $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt"; $this->cchunk["methodsynopsis"]["params"][] = array( "optional" => $opt, "type" => "", @@ -571,7 +571,7 @@ } public function format_parameter_method($open, $name, $attrs, $props) { - if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "reference") { + if ($open && isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "reference") { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['reference'] = true; } return ""; @@ -630,14 +630,14 @@ public function format_xref($open, $name, $attrs, $props) { if ($props['empty']) - return "\"" . Format::getShortDescription($attrs[Reader::XMLNS_DOCBOOK]["linkend"]) . "\""; + return "\"" . Format::getShortDescription($attrs["http://docbook.org/ns/docbook"]["linkend"]) . "\""; return ""; } public function format_verbatim($open, $name, $attrs, $props) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -652,8 +652,8 @@ } public function format_refsect($open, $name, $attrs, $props) { - if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->cchunk["role"] = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if ($open && isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->cchunk["role"] = $attrs["http://docbook.org/ns/docbook"]["role"]; if ($this->cchunk["role"] == "description") { $this->cchunk["appendlater"] = true; } @@ -670,7 +670,7 @@ public function format_tgroup($open, $name, $attrs, $props) { if ($open) { - $nbCols = $attrs[Reader::XMLNS_DOCBOOK]["cols"]; + $nbCols = $attrs["http://docbook.org/ns/docbook"]["cols"]; $ret = "\n.TS\nbox, tab (|);\n"; for ($i = 0; $i < $nbCols; $i++) $ret .= "c | "; Index: phpdotnet/phd/Index.php =================================================================== --- phpdotnet/phd/Index.php (revision 311392) +++ phpdotnet/phd/Index.php (working copy) @@ -205,8 +205,8 @@ } public function UNDEF($open, $name, $attrs, $props) { if ($open) { - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->storeInfo($name, $id, $this->currentchunk, false); if ($props["empty"]) { $this->appendID(); @@ -215,7 +215,7 @@ return false; } - if(isset($attrs[Reader::XMLNS_XML]["id"])) { + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->appendID(); } return false; @@ -289,7 +289,7 @@ } public function format_section_chunk($open, $name, $attrs, $props) { if ($open) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->isSectionChunk[] = false; return $this->UNDEF($open, $name, $attrs, $props); } @@ -314,14 +314,14 @@ $this->processFilename(); if ($open) { - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $this->isChunk[] = false; return false; } - $this->isChunk[] = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true" : true; + $this->isChunk[] = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true" : true; if (end($this->isChunk)) { $this->chunks[] = $id; @@ -371,8 +371,8 @@ if ($open) { ++$n; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = "example-" . $n; Index: phpdotnet/phd/Render.php =================================================================== --- phpdotnet/phd/Render.php (revision 311392) +++ phpdotnet/phd/Render.php (working copy) @@ -52,21 +52,21 @@ $data = $retval = $name = $open = false; switch($type) { - case \XMLReader::ELEMENT: /* {{{ */ + case 1: // 1 == XMLReader::ELEMENT /* {{{ */ $open = true; /* break intentionally omitted */ - case \XMLReader::END_ELEMENT: + case 15: // 15 == XMLReader::END_ELEMENT $name = $r->name; $depth = $r->depth; $attrs = array( - Reader::XMLNS_DOCBOOK => array(), - Reader::XMLNS_XML => array(), + "http://docbook.org/ns/docbook" => array(), + "http://www.w3.org/XML/1998/namespace" => array(), ); if ($r->hasAttributes) { $r->moveToFirstAttribute(); do { - $attrs[$r->namespaceURI ?: Reader::XMLNS_DOCBOOK][$r->localName] = $r->value; + $attrs[$r->namespaceURI ?: "http://docbook.org/ns/docbook"][$r->localName] = $r->value; } while ($r->moveToNextAttribute()); $r->moveToElement(); } @@ -86,7 +86,7 @@ continue; foreach($this as $format) { - $map = $this[$format][\XMLReader::ELEMENT]; + $map = $this[$format][1]; // 1 == XMLReader::ELEMENT if (isset($map[$name]) === false) { $data = $format->UNDEF($open, $name, $attrs, $props); @@ -117,13 +117,13 @@ break; /* }}} */ - case \XMLReader::TEXT: /* {{{ */ + case 3: // 3 == XMLReader::TEXT /* {{{ */ $value = $r->value; $eldepth = $r->depth - 1; $name = $this->STACK[$eldepth]; foreach($this as $format) { - $map = $this[$format][\XMLReader::TEXT]; + $map = $this[$format][3]; // 3 == XMLReader::TEXT if (isset($map[$name])) { $tag = $map[$name]; @@ -149,7 +149,7 @@ break; /* }}} */ - case \XMLReader::CDATA: /* {{{ */ + case 4: // 4 == XMLReader::CDATA /* {{{ */ /* Different formats may want to escape the CDATA sections differently */ $value = $r->value; foreach($this as $format) { @@ -159,8 +159,8 @@ break; /* }}} */ - case \XMLReader::WHITESPACE: /* {{{ */ - case \XMLReader::SIGNIFICANT_WHITESPACE: + case 13: // 13 == XMLReader::WHITESPACE /* {{{ */ + case 14: // 14 == XMLReader::SIGNIFICANT_WHITESPACE /* WS is always WS */ $retval = $r->value; foreach($this as $format) { @@ -169,7 +169,7 @@ break; /* }}} */ - case \XMLReader::PI: + case 7: // 7 == XMLReader::PI $target = $r->name; $data = $r->value; foreach ($this as $format) { Index: phpdotnet/phd/Format.php =================================================================== --- phpdotnet/phd/Format.php (revision 311392) +++ phpdotnet/phd/Format.php (working copy) @@ -365,7 +365,7 @@ } $autogen = array(); while ($r->read()) { - if ($r->nodeType != \XMLReader::ELEMENT) { + if ($r->nodeType != 1) { // 1 == XMLReader::ELEMENT continue; } if ($r->name == "term") {
Index: phpdotnet/phd/Format/Abstract/XHTML.php =================================================================== --- phpdotnet/phd/Format/Abstract/XHTML.php (revision 311392) +++ phpdotnet/phd/Format/Abstract/XHTML.php (working copy) @@ -20,8 +20,8 @@ public function transformFromMap($open, $tag, $name, $attrs, $props) { if ($open) { $idstr = ""; - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $idstr = ' id="' .$id. '"'; } return '<' .$tag. ' class="' .$name. '"' . $idstr . ($props["empty"] ? '/' : "") . '>'; Index: phpdotnet/phd/Package/IDE/Base.php =================================================================== --- phpdotnet/phd/Package/IDE/Base.php (revision 311392) +++ phpdotnet/phd/Package/IDE/Base.php (working copy) @@ -211,7 +211,7 @@ } public function format_set($open, $name, $attrs, $props) { - if (isset($attrs[Reader::XMLNS_XML]['id']) && $attrs[Reader::XMLNS_XML]['id'] == 'funcref') { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id']) && $attrs["http://www.w3.org/XML/1998/namespace"]['id'] == 'funcref') { $this->isFunctionRefSet = $open; } } @@ -224,7 +224,7 @@ $this->function = $this->dfunction; $this->cchunk = $this->dchunk; - $this->function['manualid'] = $attrs[Reader::XMLNS_XML]['id']; + $this->function['manualid'] = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; return; } $this->writeChunk(); @@ -247,8 +247,8 @@ return; } if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role']) && $attrs[Reader::XMLNS_DOCBOOK]['role']) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]['role']; + if (isset($attrs["http://docbook.org/ns/docbook"]['role']) && $attrs["http://docbook.org/ns/docbook"]['role']) { + $this->role = $attrs["http://docbook.org/ns/docbook"]['role']; } else { $this->role = false; } @@ -281,7 +281,7 @@ } if ($open) { $this->cchunk['methodparam'] = true; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['choice']) && $attrs[Reader::XMLNS_DOCBOOK]['choice'] == 'opt') { + if (isset($attrs["http://docbook.org/ns/docbook"]['choice']) && $attrs["http://docbook.org/ns/docbook"]['choice'] == 'opt') { $this->cchunk['param']['opt'] = 'true'; } else { $this->cchunk['param']['opt'] = 'false'; Index: phpdotnet/phd/Package/IDE/Funclist.php =================================================================== --- phpdotnet/phd/Package/IDE/Funclist.php (revision 311392) +++ phpdotnet/phd/Package/IDE/Funclist.php (working copy) @@ -49,7 +49,7 @@ } public function format_set($open, $name, $attrs, $props) { - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $attrs[Reader::XMLNS_XML]["id"] == "funcref") { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $attrs["http://www.w3.org/XML/1998/namespace"]["id"] == "funcref") { $this->isFunctionRefSet = $open; } return ""; Index: phpdotnet/phd/Package/PEAR/XHTML.php =================================================================== --- phpdotnet/phd/Package/PEAR/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/PEAR/XHTML.php (working copy) @@ -463,8 +463,8 @@ $content = $fragment = ''; $class = $name; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['linkend'])) { - $linkto = $attrs[Reader::XMLNS_DOCBOOK]['linkend']; + if (isset($attrs["http://docbook.org/ns/docbook"]['linkend'])) { + $linkto = $attrs["http://docbook.org/ns/docbook"]['linkend']; $id = $href = Format::getFilename($linkto); if ($id != $linkto) { @@ -518,8 +518,8 @@ { if ($open) { $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $idstr = ' id="' . $id . '"'; } return '<' .$tag. ' class="' .$name. '"' . $idstr. '>' . ($props['empty'] ? "</{$tag}>" : ''); @@ -548,9 +548,9 @@ } $text = $props['empty'] ? '' : $this->phd_pearapi_text; - $package = $attrs[Reader::XMLNS_PHD]['package']; - $linkend = isset($attrs[Reader::XMLNS_PHD]['linkend']) - ? $attrs[Reader::XMLNS_PHD]['linkend'] : null; + $package = $attrs["http://www.php.net/ns/phd"]['package']; + $linkend = isset($attrs["http://www.php.net/ns/phd"]['linkend']) + ? $attrs["http://www.php.net/ns/phd"]['linkend'] : null; $arLinkend = explode('::', $linkend); $class = null; $method = null; @@ -613,8 +613,8 @@ { if ($open) { $this->trim = true; - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role'])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]['role']; + if (isset($attrs["http://docbook.org/ns/docbook"]['role'])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]['role']; } else { $this->role = ''; } @@ -802,7 +802,7 @@ public function format_th_entry($open, $name, $attrs, $props) { if ($open) { - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); return '<th colspan="' .((int)$colspan). '">'; } return '</th>'; @@ -960,7 +960,7 @@ public function format_emphasis($open, $name, $attrs) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role']) && $attrs[Reader::XMLNS_DOCBOOK]['role'] == "bold") + if (isset($attrs["http://docbook.org/ns/docbook"]['role']) && $attrs["http://docbook.org/ns/docbook"]['role'] == "bold") $role = "b"; else $role = "i"; if ($open) { @@ -997,7 +997,7 @@ public function format_callout($open, $name, $attrs) { if ($open) { - return '<tr><td><a href="#'.$attrs[Reader::XMLNS_DOCBOOK]['arearefs'].'">(' .++$this->cchunk['callouts']. ')</a></td><td>'; + return '<tr><td><a href="#'.$attrs["http://docbook.org/ns/docbook"]['arearefs'].'">(' .++$this->cchunk['callouts']. ')</a></td><td>'; } return "</td></tr>\n"; } @@ -1037,7 +1037,7 @@ */ public function format_root_chunk($open, $name, $attrs, $props) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; if ($open) { $this->notify(Render::CHUNK, Render::OPEN); return "<div class=\"{$name}\">"; @@ -1046,8 +1046,8 @@ $content = $this->createTOC( $id, $name, $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1 + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1 ); $content .= "</div>\n"; @@ -1058,12 +1058,12 @@ public function format_chunk($open, $name, $attrs, $props) { $id = null; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; } - $isChunk = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true" : true; + $isChunk = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true" : true; if ($isChunk) { $this->cchunk = $this->dchunk; @@ -1075,8 +1075,8 @@ $this->lang = $props['lang']; } if ($name == 'refentry') { - if (isset($attrs[Reader::XMLNS_DOCBOOK]['role'])) { - $this->cchunk['verinfo'] = !($attrs[Reader::XMLNS_DOCBOOK]['role'] == 'noversion'); + if (isset($attrs["http://docbook.org/ns/docbook"]['role'])) { + $this->cchunk['verinfo'] = !($attrs["http://docbook.org/ns/docbook"]['role'] == 'noversion'); } else { $this->cchunk['verinfo'] = true; } @@ -1092,17 +1092,17 @@ public function format_container_chunk($open, $name, $attrs, $props) { - if (!isset($attrs[Reader::XMLNS_XML]['id'])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { if ($open) { return "<div class=\"{$name}\">"; } else { return "</div>\n"; } } - $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]['id']; + $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; - $isChunk = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true": true; + $isChunk = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true": true; if ($isChunk) { $this->cchunk = $this->dchunk; @@ -1116,8 +1116,8 @@ $toc = $this->createTOC( $id, $name, $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1 + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1 ); if ($toc) { Index: phpdotnet/phd/Package/PEAR/CHM.php =================================================================== --- phpdotnet/phd/Package/PEAR/CHM.php (revision 311392) +++ phpdotnet/phd/Package/PEAR/CHM.php (working copy) @@ -383,8 +383,8 @@ } private function collectContent($attrs) { - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $this->isChunkID($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $this->isChunkID($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->lastContent = array( "name" => Format::getShortDescription($id), "reference" => "res\\" . Index: phpdotnet/phd/Package/PHP/BigPDF.php =================================================================== --- phpdotnet/phd/Package/PHP/BigPDF.php (revision 311392) +++ phpdotnet/phd/Package/PHP/BigPDF.php (working copy) @@ -42,9 +42,9 @@ } parent::setPdfDoc($pdfDoc); - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) parent::setChunkInfo("xml-base", $base); - $id = $attrs[Reader::XMLNS_XML]["id"]; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(Format::getShortDescription($id), null, true); $this->setIdToPage($id); Index: phpdotnet/phd/Package/PHP/Epub.php =================================================================== --- phpdotnet/phd/Package/PHP/Epub.php (revision 311392) +++ phpdotnet/phd/Package/PHP/Epub.php (working copy) @@ -302,8 +302,8 @@ } protected function collectContent($attrs, $class, $child) { - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $id = $attrs[Reader::XMLNS_XML]['id']; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $this->lastContent = array( 'id' => $id, 'title' => $this->getShortDescription($id), Index: phpdotnet/phd/Package/PHP/XHTML.php =================================================================== --- phpdotnet/phd/Package/PHP/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/PHP/XHTML.php (working copy) @@ -218,7 +218,7 @@ $acronyms = array(); while ($r->read()) { - if ($r->nodeType != \XMLReader::ELEMENT) { + if ($r->nodeType != 1) { // 1 == XMLReader::ELEMENT continue; } if ($r->name == "term") { @@ -268,8 +268,8 @@ public function format_fieldsynopsis_varname($open, $name, $attrs) { if ($open) { $href = ""; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $linkto = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $linkto = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $href = Format::getFilename($linkto); if ($this->chunked) { @@ -294,7 +294,7 @@ } return ' <var class="'.$name.'">'.$href.'$'; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { return '</a></var>'; } return '</var>'; @@ -472,8 +472,8 @@ /*Chunk Functions*/ public function format_container_chunk($open, $name, $attrs, $props) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; - if (!isset($attrs[Reader::XMLNS_PHD]["chunk"]) || $attrs[Reader::XMLNS_PHD]["chunk"] == "true") { + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; + if (!isset($attrs["http://www.php.net/ns/phd"]["chunk"]) || $attrs["http://www.php.net/ns/phd"]["chunk"] == "true") { $this->cchunk = $this->dchunk; } @@ -520,7 +520,7 @@ } public function format_root_chunk($open, $name, $attrs) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; if ($open) { $this->notify(Render::CHUNK, Render::OPEN); return '<div id="'.$id.'" class="'.$name.'">'; @@ -561,8 +561,8 @@ public function format_chunk($open, $name, $attrs, $props) { if ($open) { - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid(); @@ -570,7 +570,7 @@ } $this->CURRENT_CHUNK = $this->CURRENT_ID = $id; - if (!isset($attrs[Reader::XMLNS_PHD]["chunk"]) || $attrs[Reader::XMLNS_PHD]["chunk"] == "true") { + if (!isset($attrs["http://www.php.net/ns/phd"]["chunk"]) || $attrs["http://www.php.net/ns/phd"]["chunk"] == "true") { $this->cchunk = $this->dchunk; $this->notify(Render::CHUNK, Render::OPEN); } @@ -578,8 +578,8 @@ $this->lang = $props["lang"]; } if ($name == "refentry") { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->cchunk["verinfo"] = !($attrs[Reader::XMLNS_DOCBOOK]["role"] == "noversion"); + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->cchunk["verinfo"] = !($attrs["http://docbook.org/ns/docbook"]["role"] == "noversion"); } else { $this->cchunk["verinfo"] = true; } Index: phpdotnet/phd/Package/PHP/CHM.php =================================================================== --- phpdotnet/phd/Package/PHP/CHM.php (revision 311392) +++ phpdotnet/phd/Package/PHP/CHM.php (working copy) @@ -417,8 +417,8 @@ } private function collectContent($attrs) { - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->lastContent = array( "name" => Format::getShortDescription($id), "reference" => "res" . DIRECTORY_SEPARATOR . Index: phpdotnet/phd/Package/PHP/KDevelop.php =================================================================== --- phpdotnet/phd/Package/PHP/KDevelop.php (revision 311392) +++ phpdotnet/phd/Package/PHP/KDevelop.php (working copy) @@ -123,8 +123,8 @@ } public function format_tocsect1($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $hasChild = (count(Format::getChildren($id)) > 0); if ($open) { $name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8'); @@ -138,8 +138,8 @@ } public function format_tocsect2($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $hasChild = (count(Format::getChildren($id)) > 0); if ($open) { $name = htmlspecialchars(Format::getShortDescription($id), ENT_QUOTES, 'UTF-8'); @@ -150,8 +150,8 @@ } public function format_refentry($open, $name, $attrs) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) return ""; - $id = $attrs[Reader::XMLNS_XML]["id"]; + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) return ""; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; if ($open) { $this->currentEntryName = null; } Index: phpdotnet/phd/Package/PHP/PDF.php =================================================================== --- phpdotnet/phd/Package/PHP/PDF.php (revision 311392) +++ phpdotnet/phd/Package/PHP/PDF.php (working copy) @@ -155,10 +155,10 @@ v("PDF Compression failed, you need to compile libharu with Zlib...", E_USER_WARNING); } parent::setPdfDoc($pdfDoc); - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) parent::setChunkInfo("xml-base", $base); - $id = $attrs[Reader::XMLNS_XML]["id"]; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(Format::getShortDescription($id), null, true); $this->setIdToPage($id); @@ -192,11 +192,11 @@ } else { parent::getPdfDoc()->add(PdfWriter::LINE_JUMP); } - if (isset($attrs[Reader::XMLNS_XML]["base"]) && $base = $attrs[Reader::XMLNS_XML]["base"]) { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["base"]) && $base = $attrs["http://www.w3.org/XML/1998/namespace"]["base"]) { parent::setChunkInfo("xml-base", $base); } - if (isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $parentId = Format::getParent($id); if (isset($this->cchunk["id-to-outline"][$parentId])) { $this->cchunk["id-to-outline"][$id] = parent::getPdfDoc()->createOutline @@ -314,7 +314,7 @@ } public function format_collect_id($open, $name, $attrs, $props, $newpage = false) { - if ($open && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if ($open && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $this->setIdToPage($id); } return false; Index: phpdotnet/phd/Package/Generic/PDF.php =================================================================== --- phpdotnet/phd/Package/Generic/PDF.php (revision 311392) +++ phpdotnet/phd/Package/Generic/PDF.php (working copy) @@ -546,13 +546,13 @@ public function format_link($open, $name, $attrs, $props) { if ($open && ! $props["empty"]) { $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0, 0, 1)); // blue - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $this->cchunk["linkend"] = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $this->cchunk["linkend"] = $attrs["http://docbook.org/ns/docbook"]["linkend"]; } elseif(isset($attrs[Reader::XMLNS_XLINK]["href"])) { $this->cchunk["href"] = $attrs[Reader::XMLNS_XLINK]["href"]; } - } elseif ($open && $name == "xref" && isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"]) - && $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]) { + } elseif ($open && $name == "xref" && isset($attrs["http://docbook.org/ns/docbook"]["linkend"]) + && $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]) { $this->cchunk["linkend"] = $linkend; $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0, 0, 1)); // blue $this->format_link_text(Format::getShortDescription($linkend), $name); @@ -720,13 +720,13 @@ public function format_colspec($open, $name, $attrs) { if ($open) { - Format::colspec($attrs[Reader::XMLNS_DOCBOOK]); + Format::colspec($attrs["http://docbook.org/ns/docbook"]); } return ""; } public function format_thead($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); $this->pdfDoc->setFont(PdfWriter::FONT_BOLD); } else { $this->pdfDoc->revertFont(); @@ -735,14 +735,14 @@ } public function format_tbody($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); } return ""; } public function format_row($open, $name, $attrs) { if ($open) { Format::initRow(); - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); $colCount = Format::getColCount(); $this->pdfDoc->add(PdfWriter::TABLE_ROW, array($colCount, $valign)); } else { @@ -757,9 +757,9 @@ $this->pdfDoc->add(PdfWriter::TABLE_END_ENTRY); } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align); - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); $this->pdfDoc->add(PdfWriter::TABLE_ENTRY, array($colspan, 1, $align)); } else { $this->pdfDoc->add(PdfWriter::TABLE_END_ENTRY); @@ -774,7 +774,7 @@ return; } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $align = (isset($dbattrs["align"]) ? $dbattrs["align"] : $align); $retval = ""; if (isset($dbattrs["colname"])) { @@ -804,9 +804,9 @@ public function format_tgroup($open, $name, $attrs, $props) { if ($open) { - Format::tgroup($attrs[Reader::XMLNS_DOCBOOK]); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["cols"])) - $this->pdfDoc->add(PdfWriter::TABLE, $attrs[Reader::XMLNS_DOCBOOK]["cols"]); + Format::tgroup($attrs["http://docbook.org/ns/docbook"]); + if (isset($attrs["http://docbook.org/ns/docbook"]["cols"])) + $this->pdfDoc->add(PdfWriter::TABLE, $attrs["http://docbook.org/ns/docbook"]["cols"]); } else { } return ""; @@ -856,7 +856,7 @@ public function format_methodparam_parameter($open, $name, $attrs, $props) { if ($props["empty"]) return ''; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { $this->pdfDoc->setFont(PdfWriter::FONT_VERBATIM, 10); $this->pdfDoc->appendText(" &$"); return ''; @@ -872,7 +872,7 @@ public function format_parameter($open, $name, $attrs, $props) { if ($props["empty"]) return ''; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { $this->pdfDoc->setFont(PdfWriter::FONT_VERBATIM_ITALIC, 10); $this->pdfDoc->appendText(" &"); return ''; @@ -890,7 +890,7 @@ if ($this->params["count"] == 0) { $content .= " ("; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt") { + if (isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt") { $this->params["opt"]++; $content .= " ["; } else if($this->params["opt"]) { @@ -916,7 +916,7 @@ public function format_classsynopsisinfo($open, $name, $attrs, $props) { $this->cchunk["classsynopsisinfo"] = $this->dchunk["classsynopsisinfo"]; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { $this->format_para($open, $name, $attrs, $props); $this->pdfDoc->appendText("/* "); return ''; @@ -924,7 +924,7 @@ return $this->format_para($open, $name, $attrs, $props); } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { $this->pdfDoc->appendText(" */"); return $this->format_para($open, $name, $attrs, $props); } @@ -987,7 +987,7 @@ // Footnotes & Callouts {{{ public function format_footnoteref($open, $name, $attrs, $props) { if ($open) { - $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $found = false; foreach($this->cchunk["footnote"] as $k => $note) { if ($note["id"] === $linkend) { @@ -1003,7 +1003,7 @@ public function format_footnote($open, $name, $attrs, $props) { if ($open) { $count = count($this->cchunk["footnote"]); - $noteid = isset($attrs[Reader::XMLNS_XML]["id"]) ? $attrs[Reader::XMLNS_XML]["id"] : $count + 1; + $noteid = isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? $attrs["http://www.w3.org/XML/1998/namespace"]["id"] : $count + 1; $note = array("id" => $noteid, "str" => ""); $this->cchunk["footnote"][$count] = $note; if ($this->cchunk["table"]) { @@ -1024,10 +1024,10 @@ } public function format_co($open, $name, $attrs, $props) { - if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"]) && $id = $attrs[Reader::XMLNS_XML]["id"]) { + if (($open || $props["empty"]) && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) && $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]) { $co = ++$this->cchunk["co"]; $this->pdfDoc->setFont(PdfWriter::FONT_NORMAL, 12, array(0,0,1)); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkends"]) && $linkends = $attrs[Reader::XMLNS_DOCBOOK]["linkends"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["linkends"]) && $linkends = $attrs["http://docbook.org/ns/docbook"]["linkends"]) { $linkAreas = $this->pdfDoc->add(PdfWriter::LINK_ANNOTATION, "[{$co}]"); if (!isset($this->cchunk["links-to-resolve"][$linkends])) $this->cchunk["links-to-resolve"][$linkends] = array(); @@ -1055,7 +1055,7 @@ if ($open) { $co = ++$this->cchunk["co"]; $this->pdfDoc->setFont(PdfWriter::FONT_BOLD, 12, array(0,0,1)); - if (isset($attrs[Reader::XMLNS_DOCBOOK]["arearefs"]) && $ref = $attrs[Reader::XMLNS_DOCBOOK]["arearefs"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["arearefs"]) && $ref = $attrs["http://docbook.org/ns/docbook"]["arearefs"]) { $linkAreas = $this->pdfDoc->add(PdfWriter::LINK_ANNOTATION, "[{$co}]"); if (!isset($this->cchunk["links-to-resolve"][$ref])) $this->cchunk["links-to-resolve"][$ref] = array(); @@ -1123,7 +1123,7 @@ public function format_imagedata($open, $name, $attrs, $props) { if ($props["empty"] && isset($this->cchunk["xml-base"]) && ($base = $this->cchunk["xml-base"]) && - isset($attrs[Reader::XMLNS_DOCBOOK]["fileref"]) && ($fileref = $attrs[Reader::XMLNS_DOCBOOK]["fileref"])) { + isset($attrs["http://docbook.org/ns/docbook"]["fileref"]) && ($fileref = $attrs["http://docbook.org/ns/docbook"]["fileref"])) { $imagePath = Config::xml_root() . DIRECTORY_SEPARATOR . $base . $fileref; if (file_exists($imagePath)) $this->pdfDoc->add(PdfWriter::IMAGE, $imagePath); Index: phpdotnet/phd/Package/Generic/TocFeed.php =================================================================== --- phpdotnet/phd/Package/Generic/TocFeed.php (revision 311392) +++ phpdotnet/phd/Package/Generic/TocFeed.php (working copy) @@ -312,20 +312,20 @@ return ''; } - if (isset($attrs[Reader::XMLNS_PHD]['chunk']) - && $attrs[Reader::XMLNS_PHD]['chunk'] == 'false' + if (isset($attrs["http://www.php.net/ns/phd"]['chunk']) + && $attrs["http://www.php.net/ns/phd"]['chunk'] == 'false' ) { //not chunked? no feed! return ''; } - if (!isset($attrs[Reader::XMLNS_XML]['id'])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { //if we do not have a hard id, then // we cannot link to the file. // So without an id, there is no atom file return ''; } - $id = $attrs[Reader::XMLNS_XML]['id']; + $id = $attrs["http://www.w3.org/XML/1998/namespace"]['id']; $this->writeChunk( $id, $this->createAtomToc($id) Index: phpdotnet/phd/Package/Generic/XHTML.php =================================================================== --- phpdotnet/phd/Package/Generic/XHTML.php (revision 311392) +++ phpdotnet/phd/Package/Generic/XHTML.php (working copy) @@ -510,11 +510,11 @@ return '<div class="phd-toc">'; } return $this->createToc( - $attrs[Reader::XMLNS_PHD]['element'], + $attrs["http://www.php.net/ns/phd"]['element'], 'phd-toc', $props, - isset($attrs[Reader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[Reader::XMLNS_PHD]['toc-depth'] : 1, + isset($attrs["http://www.php.net/ns/phd"]['toc-depth']) + ? (int)$attrs["http://www.php.net/ns/phd"]['toc-depth'] : 1, false ) . "</div>\n"; } @@ -595,8 +595,8 @@ if ($open) { $link = $class = $content = ""; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["linkend"])) { - $link = $this->createLink($attrs[Reader::XMLNS_DOCBOOK]["linkend"]); + if (isset($attrs["http://docbook.org/ns/docbook"]["linkend"])) { + $link = $this->createLink($attrs["http://docbook.org/ns/docbook"]["linkend"]); } elseif (isset($attrs[Reader::XMLNS_XLINK]["href"])) { $link = $attrs[Reader::XMLNS_XLINK]["href"]; @@ -615,7 +615,7 @@ public function format_xref($open, $name, $attrs, $props) { if ($open) { $desc = ""; - $link = $this->createLink($attrs[Reader::XMLNS_DOCBOOK]["linkend"], $desc); + $link = $this->createLink($attrs["http://docbook.org/ns/docbook"]["linkend"], $desc); $ret = '<a href="' .$link. '" class="' .$name. '">' .$desc; @@ -629,10 +629,10 @@ public function format_option($open, $name, $attrs) { if ($open) { - if(!isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $attrs[Reader::XMLNS_DOCBOOK]["role"] = "unknown"; + if(!isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $attrs["http://docbook.org/ns/docbook"]["role"] = "unknown"; } - $this->role = $role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + $this->role = $role = $attrs["http://docbook.org/ns/docbook"]["role"]; return '<strong class="' .$name.' ' .$role. '">'; } $this->role = null; @@ -641,8 +641,8 @@ public function format_literal($open, $name, $attrs) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -701,9 +701,9 @@ break; case "othername": - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { /* We might want to add support for other roles */ - switch($attrs[Reader::XMLNS_DOCBOOK]["role"]) { + switch($attrs["http://docbook.org/ns/docbook"]["role"]) { case "nickname": $class = " nickname"; break; @@ -720,8 +720,8 @@ public function format_container_chunk_top($open, $name, $attrs, $props) { $this->cchunk = $this->dchunk; $this->cchunk["name"] = $name; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid("phd"); } @@ -758,8 +758,8 @@ public function format_container_chunk_below($open, $name, $attrs, $props) { $this->cchunk = $this->dchunk; $this->cchunk["name"] = $name; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { /* FIXME: This will obviously not exist in the db.. */ $id = uniqid("phd"); @@ -769,7 +769,7 @@ $this->CURRENT_CHUNK = $id; $this->notify(Render::CHUNK, Render::OPEN); - return '<div id="' .$attrs[Reader::XMLNS_XML]["id"]. '" class="' .$name. '">'; + return '<div id="' .$attrs["http://www.w3.org/XML/1998/namespace"]["id"]. '" class="' .$name. '">'; } $toc = '<ol>'; @@ -788,7 +788,7 @@ } public function format_section_chunk($open, $name, $attrs, $props) { if ($open) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->isSectionChunk[] = false; return $this->transformFromMap($open, "div", $name, $attrs, $props); } @@ -803,8 +803,8 @@ public function format_chunk($open, $name, $attrs, $props) { if ($open) { $this->cchunk = $this->dchunk; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = uniqid("phd"); } @@ -851,13 +851,13 @@ } public function format_refsect($open, $name, $attrs) { if ($open) { - if(!isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $attrs[Reader::XMLNS_DOCBOOK]["role"] = "unknown"; + if(!isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $attrs["http://docbook.org/ns/docbook"]["role"] = "unknown"; } - $this->role = $role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + $this->role = $role = $attrs["http://docbook.org/ns/docbook"]["role"]; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["id"])) { - $id = $attrs[Reader::XMLNS_DOCBOOK]["id"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["id"])) { + $id = $attrs["http://docbook.org/ns/docbook"]["id"]; } else { $id = $name. "-" . $this->CURRENT_CHUNK . "-" . $role; @@ -893,13 +893,13 @@ public function format_classsynopsisinfo($open, $name, $attrs) { $this->cchunk["classsynopsisinfo"] = $this->dchunk["classsynopsisinfo"]; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { return '<div class="'.$name.' classsynopsisinfo_comment">/* '; } return '<div class="'.$name.'">'; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "comment") { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "comment") { return ' */</div>'; } $this->cchunk["classsynopsis"]["close"] = true; @@ -975,7 +975,7 @@ if ($props["empty"]) return; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { return ' <tt class="parameter reference">&$'; } return ' <tt class="parameter">$'; @@ -992,7 +992,7 @@ if ($props["empty"]) return; if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { return '<i><tt class="parameter reference">&'; } return '<i><tt class="parameter">'; @@ -1013,7 +1013,7 @@ if ($this->params["count"] == 0) { $content .= " ("; } - if (isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt") { + if (isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt") { $this->params["opt"]++; $content .= "["; } else if($this->params["opt"]) { @@ -1054,7 +1054,7 @@ public function format_footnoteref($open, $name, $attrs, $props) { if ($open) { - $linkend = $attrs[Reader::XMLNS_DOCBOOK]["linkend"]; + $linkend = $attrs["http://docbook.org/ns/docbook"]["linkend"]; $found = false; foreach($this->cchunk["footnote"] as $k => $note) { if ($note["id"] === $linkend) { @@ -1068,7 +1068,7 @@ public function format_footnote($open, $name, $attrs, $props) { if ($open) { $count = count($this->cchunk["footnote"]); - $noteid = isset($attrs[Reader::XMLNS_XML]["id"]) ? $attrs[Reader::XMLNS_XML]["id"] : $count + 1; + $noteid = isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? $attrs["http://www.w3.org/XML/1998/namespace"]["id"] : $count + 1; $note = array("id" => $noteid, "str" => ""); $this->cchunk["footnote"][$count] = $note; if ($this->cchunk["table"]) { @@ -1109,9 +1109,9 @@ /* }}} */ public function format_co($open, $name, $attrs, $props) { - if (($open || $props["empty"]) && isset($attrs[Reader::XMLNS_XML]["id"])) { + if (($open || $props["empty"]) && isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $co = ++$this->cchunk["co"]; - return '<a name="'.$attrs[Reader::XMLNS_XML]["id"].'" id="'.$attrs[Reader::XMLNS_XML]["id"].'">' .str_repeat("*", $co) .'</a>'; + return '<a name="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"].'" id="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"].'">' .str_repeat("*", $co) .'</a>'; } /* Suppress closing tag if any */ return ""; @@ -1125,7 +1125,7 @@ } public function format_callout($open, $name, $attrs) { if ($open) { - return '<tr><td><a href="#'.$attrs[Reader::XMLNS_DOCBOOK]["arearefs"].'">' .str_repeat("*", ++$this->cchunk["callouts"]). '</a></td><td>'; + return '<tr><td><a href="#'.$attrs["http://docbook.org/ns/docbook"]["arearefs"].'">' .str_repeat("*", ++$this->cchunk["callouts"]). '</a></td><td>'; } return "</td></tr>\n"; } @@ -1193,7 +1193,7 @@ } public function format_varlistentry($open, $name, $attrs) { if ($open) { - return isset($attrs[Reader::XMLNS_XML]["id"]) ? '<dt id="'.$attrs[Reader::XMLNS_XML]["id"]. '">' : "<dt>\n"; + return isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"]) ? '<dt id="'.$attrs["http://www.w3.org/XML/1998/namespace"]["id"]. '">' : "<dt>\n"; } return "</dt>\n"; } @@ -1226,7 +1226,7 @@ } public function format_systemitem($open, $name, $attrs) { if ($open) { - $val = isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) ? $attrs[Reader::XMLNS_DOCBOOK]["role"] : null; + $val = isset($attrs["http://docbook.org/ns/docbook"]["role"]) ? $attrs["http://docbook.org/ns/docbook"]["role"] : null; switch($val) { case "directive": /* FIXME: Different roles should probably be handled differently */ @@ -1244,8 +1244,8 @@ } public function format_programlisting($open, $name, $attrs) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -1347,11 +1347,11 @@ $this->cchunk["mediaobject"]["alt"] = $value; } public function format_imagedata($open, $name, $attrs) { - $file = $attrs[Reader::XMLNS_DOCBOOK]["fileref"]; + $file = $attrs["http://docbook.org/ns/docbook"]["fileref"]; if ($newpath = $this->mediamanager->handleFile($file)) { $curfile = $this->mediamanager->findFile($file); - $width = isset($attrs[Reader::XMLNS_DOCBOOK]["width"]) ? 'width="' . $attrs[Reader::XMLNS_DOCBOOK]["width"] . '"' : ''; - $height = isset($attrs[Reader::XMLNS_DOCBOOK]["depth"]) ? 'height="' . $attrs[Reader::XMLNS_DOCBOOK]["depth"] . '"' : ''; + $width = isset($attrs["http://docbook.org/ns/docbook"]["width"]) ? 'width="' . $attrs["http://docbook.org/ns/docbook"]["width"] . '"' : ''; + $height = isset($attrs["http://docbook.org/ns/docbook"]["depth"]) ? 'height="' . $attrs["http://docbook.org/ns/docbook"]["depth"] . '"' : ''; $alt = 'alt="' . ($this->cchunk["mediaobject"]["alt"] !== false ? $this->cchunk["mediaobject"]["alt"] : basename($file)) . '"'; // Generate height and width when none are supplied. @@ -1379,15 +1379,15 @@ if ($open) { $this->cchunk["table"] = true; $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]["id"])) { - $idstr = ' id="' . $attrs[Reader::XMLNS_XML]["id"] . '"'; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $idstr = ' id="' . $attrs["http://www.w3.org/XML/1998/namespace"]["id"] . '"'; } return '<table' . $idstr . ' class="doctable ' .$name. '">'; } $this->cchunk["table"] = false; $str = ""; if (isset($this->cchunk["tablefootnotes"]) && $this->cchunk["tablefootnotes"]) { - $opts = array(Reader::XMLNS_DOCBOOK => array()); + $opts = array("http://docbook.org/ns/docbook" => array()); $str = $this->format_tbody(true, "footnote", $opts, $props); $str .= $this->format_row(true, "footnote", $opts, $props); @@ -1410,7 +1410,7 @@ } public function format_tgroup($open, $name, $attrs) { if ($open) { - Format::tgroup($attrs[Reader::XMLNS_DOCBOOK]); + Format::tgroup($attrs["http://docbook.org/ns/docbook"]); return ''; } return ''; @@ -1433,7 +1433,7 @@ } public function format_colspec($open, $name, $attrs) { if ($open) { - $str = self::parse_table_entry_attributes(Format::colspec($attrs[Reader::XMLNS_DOCBOOK])); + $str = self::parse_table_entry_attributes(Format::colspec($attrs["http://docbook.org/ns/docbook"])); return '<col '.$str. ' />'; } @@ -1441,14 +1441,14 @@ } public function format_th($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<' .$name. ' valign="' .$valign. '">'; } return "</$name>\n"; } public function format_tbody($open, $name, $attrs) { if ($open) { - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<tbody valign="' .$valign. '" class="' .$name. '">'; } return "</tbody>"; @@ -1456,11 +1456,11 @@ public function format_row($open, $name, $attrs) { if ($open) { $idstr = ''; - if (isset($attrs[Reader::XMLNS_XML]['id'])) { - $idstr = ' id="'. $attrs[Reader::XMLNS_XML]['id']. '"'; + if (isset($attrs["http://www.w3.org/XML/1998/namespace"]['id'])) { + $idstr = ' id="'. $attrs["http://www.w3.org/XML/1998/namespace"]['id']. '"'; } Format::initRow(); - $valign = Format::valign($attrs[Reader::XMLNS_DOCBOOK]); + $valign = Format::valign($attrs["http://docbook.org/ns/docbook"]); return '<tr'.$idstr.' valign="' .$valign. '">'; } return "</tr>\n"; @@ -1470,7 +1470,7 @@ return '<th class="empty"> </th>'; } if ($open) { - $colspan = Format::colspan($attrs[Reader::XMLNS_DOCBOOK]); + $colspan = Format::colspan($attrs["http://docbook.org/ns/docbook"]); if ($colspan == 1) { return '<th>'; } else { @@ -1484,7 +1484,7 @@ return '<td class="empty"> </td>'; } if ($open) { - $dbattrs = Format::getColspec($attrs[Reader::XMLNS_DOCBOOK]); + $dbattrs = Format::getColspec($attrs["http://docbook.org/ns/docbook"]); $retval = ""; if (isset($dbattrs["colname"])) { @@ -1519,13 +1519,13 @@ $doc->appendChild($node); $xp = new \DOMXPath($doc); - $xp->registerNamespace("db", Reader::XMLNS_DOCBOOK); + $xp->registerNamespace("db", "http://docbook.org/ns/docbook"); $questions = $xp->query("//db:qandaentry/db:question"); $retval = '<div class="qandaset"><ol class="qandaset_questions">'; foreach($questions as $node) { - $id = $xp->evaluate("ancestor::db:qandaentry", $node)->item(0)->getAttributeNs(Reader::XMLNS_XML, "id"); + $id = $xp->evaluate("ancestor::db:qandaentry", $node)->item(0)->getAttributeNs("http://www.w3.org/XML/1998/namespace", "id"); /* FIXME: No ID? How can we create an anchor for it then? */ if (!$id) { @@ -1546,7 +1546,7 @@ } public function format_phd_question($open, $name, $attrs, $props) { if ($open) { - $href = $this->createLink($attrs[Reader::XMLNS_XML]["id"]); + $href = $this->createLink($attrs["http://www.w3.org/XML/1998/namespace"]["id"]); return '<li><a href="' .$href. '">'; } return '</a></li>'; @@ -1654,8 +1654,8 @@ public function format_orderedlist($open, $name, $attrs, $props) { if ($open) { $numeration = "1"; - if (isset($attrs[Reader::XMLNS_DOCBOOK]["numeration"])) { - switch($attrs[Reader::XMLNS_DOCBOOK]["numeration"]) { + if (isset($attrs["http://docbook.org/ns/docbook"]["numeration"])) { + switch($attrs["http://docbook.org/ns/docbook"]["numeration"]) { case "upperalpha": $numeration = "A"; break; Index: phpdotnet/phd/Package/Generic/Manpage.php =================================================================== --- phpdotnet/phd/Package/Generic/Manpage.php (revision 311392) +++ phpdotnet/phd/Package/Generic/Manpage.php (working copy) @@ -539,8 +539,8 @@ public function format_methodparam($open, $name, $attrs, $props) { if ($open) { - $opt = isset($attrs[Reader::XMLNS_DOCBOOK]["choice"]) && - $attrs[Reader::XMLNS_DOCBOOK]["choice"] == "opt"; + $opt = isset($attrs["http://docbook.org/ns/docbook"]["choice"]) && + $attrs["http://docbook.org/ns/docbook"]["choice"] == "opt"; $this->cchunk["methodsynopsis"]["params"][] = array( "optional" => $opt, "type" => "", @@ -571,7 +571,7 @@ } public function format_parameter_method($open, $name, $attrs, $props) { - if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"]) && $attrs[Reader::XMLNS_DOCBOOK]["role"] == "reference") { + if ($open && isset($attrs["http://docbook.org/ns/docbook"]["role"]) && $attrs["http://docbook.org/ns/docbook"]["role"] == "reference") { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['reference'] = true; } return ""; @@ -630,14 +630,14 @@ public function format_xref($open, $name, $attrs, $props) { if ($props['empty']) - return "\"" . Format::getShortDescription($attrs[Reader::XMLNS_DOCBOOK]["linkend"]) . "\""; + return "\"" . Format::getShortDescription($attrs["http://docbook.org/ns/docbook"]["linkend"]) . "\""; return ""; } public function format_verbatim($open, $name, $attrs, $props) { if ($open) { - if (isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->role = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if (isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->role = $attrs["http://docbook.org/ns/docbook"]["role"]; } else { $this->role = false; } @@ -652,8 +652,8 @@ } public function format_refsect($open, $name, $attrs, $props) { - if ($open && isset($attrs[Reader::XMLNS_DOCBOOK]["role"])) { - $this->cchunk["role"] = $attrs[Reader::XMLNS_DOCBOOK]["role"]; + if ($open && isset($attrs["http://docbook.org/ns/docbook"]["role"])) { + $this->cchunk["role"] = $attrs["http://docbook.org/ns/docbook"]["role"]; if ($this->cchunk["role"] == "description") { $this->cchunk["appendlater"] = true; } @@ -670,7 +670,7 @@ public function format_tgroup($open, $name, $attrs, $props) { if ($open) { - $nbCols = $attrs[Reader::XMLNS_DOCBOOK]["cols"]; + $nbCols = $attrs["http://docbook.org/ns/docbook"]["cols"]; $ret = "\n.TS\nbox, tab (|);\n"; for ($i = 0; $i < $nbCols; $i++) $ret .= "c | "; Index: phpdotnet/phd/Index.php =================================================================== --- phpdotnet/phd/Index.php (revision 311392) +++ phpdotnet/phd/Index.php (working copy) @@ -205,8 +205,8 @@ } public function UNDEF($open, $name, $attrs, $props) { if ($open) { - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; $this->storeInfo($name, $id, $this->currentchunk, false); if ($props["empty"]) { $this->appendID(); @@ -215,7 +215,7 @@ return false; } - if(isset($attrs[Reader::XMLNS_XML]["id"])) { + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->appendID(); } return false; @@ -289,7 +289,7 @@ } public function format_section_chunk($open, $name, $attrs, $props) { if ($open) { - if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + if (!isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { $this->isSectionChunk[] = false; return $this->UNDEF($open, $name, $attrs, $props); } @@ -314,14 +314,14 @@ $this->processFilename(); if ($open) { - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $this->isChunk[] = false; return false; } - $this->isChunk[] = isset($attrs[Reader::XMLNS_PHD]['chunk']) - ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true" : true; + $this->isChunk[] = isset($attrs["http://www.php.net/ns/phd"]['chunk']) + ? $attrs["http://www.php.net/ns/phd"]['chunk'] == "true" : true; if (end($this->isChunk)) { $this->chunks[] = $id; @@ -371,8 +371,8 @@ if ($open) { ++$n; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; + if(isset($attrs["http://www.w3.org/XML/1998/namespace"]["id"])) { + $id = $attrs["http://www.w3.org/XML/1998/namespace"]["id"]; } else { $id = "example-" . $n; Index: phpdotnet/phd/Render.php =================================================================== --- phpdotnet/phd/Render.php (revision 311392) +++ phpdotnet/phd/Render.php (working copy) @@ -52,21 +52,21 @@ $data = $retval = $name = $open = false; switch($type) { - case \XMLReader::ELEMENT: /* {{{ */ + case 1: // 1 == XMLReader::ELEMENT /* {{{ */ $open = true; /* break intentionally omitted */ - case \XMLReader::END_ELEMENT: + case 15: // 15 == XMLReader::END_ELEMENT $name = $r->name; $depth = $r->depth; $attrs = array( - Reader::XMLNS_DOCBOOK => array(), - Reader::XMLNS_XML => array(), + "http://docbook.org/ns/docbook" => array(), + "http://www.w3.org/XML/1998/namespace" => array(), ); if ($r->hasAttributes) { $r->moveToFirstAttribute(); do { - $attrs[$r->namespaceURI ?: Reader::XMLNS_DOCBOOK][$r->localName] = $r->value; + $attrs[$r->namespaceURI ?: "http://docbook.org/ns/docbook"][$r->localName] = $r->value; } while ($r->moveToNextAttribute()); $r->moveToElement(); } @@ -86,7 +86,7 @@ continue; foreach($this as $format) { - $map = $this[$format][\XMLReader::ELEMENT]; + $map = $this[$format][1]; // 1 == XMLReader::ELEMENT if (isset($map[$name]) === false) { $data = $format->UNDEF($open, $name, $attrs, $props); @@ -117,13 +117,13 @@ break; /* }}} */ - case \XMLReader::TEXT: /* {{{ */ + case 3: // 3 == XMLReader::TEXT /* {{{ */ $value = $r->value; $eldepth = $r->depth - 1; $name = $this->STACK[$eldepth]; foreach($this as $format) { - $map = $this[$format][\XMLReader::TEXT]; + $map = $this[$format][3]; // 3 == XMLReader::TEXT if (isset($map[$name])) { $tag = $map[$name]; @@ -149,7 +149,7 @@ break; /* }}} */ - case \XMLReader::CDATA: /* {{{ */ + case 4: // 4 == XMLReader::CDATA /* {{{ */ /* Different formats may want to escape the CDATA sections differently */ $value = $r->value; foreach($this as $format) { @@ -159,8 +159,8 @@ break; /* }}} */ - case \XMLReader::WHITESPACE: /* {{{ */ - case \XMLReader::SIGNIFICANT_WHITESPACE: + case 13: // 13 == XMLReader::WHITESPACE /* {{{ */ + case 14: // 14 == XMLReader::SIGNIFICANT_WHITESPACE /* WS is always WS */ $retval = $r->value; foreach($this as $format) { @@ -169,7 +169,7 @@ break; /* }}} */ - case \XMLReader::PI: + case 7: // 7 == XMLReader::PI $target = $r->name; $data = $r->value; foreach ($this as $format) { Index: phpdotnet/phd/Format.php =================================================================== --- phpdotnet/phd/Format.php (revision 311392) +++ phpdotnet/phd/Format.php (working copy) @@ -365,7 +365,7 @@ } $autogen = array(); while ($r->read()) { - if ($r->nodeType != \XMLReader::ELEMENT) { + if ($r->nodeType != 1) { // 1 == XMLReader::ELEMENT continue; } if ($r->name == "term") {