bjori Mon Jun 25 12:38:08 2007 UTC
Modified files:
/livedocs style_mapping.php xml_classes5.php
Log:
More phpdoc docbook5 upgrades
http://cvs.php.net/viewvc.cgi/livedocs/style_mapping.php?r1=1.36&r2=1.37&diff_format=u
Index: livedocs/style_mapping.php
diff -u livedocs/style_mapping.php:1.36 livedocs/style_mapping.php:1.37
--- livedocs/style_mapping.php:1.36 Tue Jun 19 23:33:48 2007
+++ livedocs/style_mapping.php Mon Jun 25 12:38:08 2007
@@ -18,7 +18,7 @@
// | Helper functions for formatting elements |
// +----------------------------------------------------------------------+
//
-// $Id: style_mapping.php,v 1.36 2007/06/19 23:33:48 bjori Exp $
+// $Id: style_mapping.php,v 1.37 2007/06/25 12:38:08 bjori Exp $
// almost XPATH.. ;-)
$map = array(
@@ -27,7 +27,6 @@
'appendix/title' => 'h1',
'author' => 'format_name',
'authorgroup' => 'format_authorgroup',
- 'bookinfo/title' => 'h1',
'chapter/title' => 'h1',
'classname' => 'span',
'classsynopsis' => 'format_class_synopsis',
@@ -49,6 +48,7 @@
'function' => 'format_function',
'glossterm' => 'span',
'htmlcode' => 'format_htmlcode',
+ 'info/title' => 'h1',
'informaltable' => 'table',
'informaltable/title' => 'caption',
'itemizedlist' => 'ul',
@@ -138,7 +138,7 @@
$cl[] = $child->children[0]->content;
}
}
- switch ($node->attributes['id']) {
+ switch ($node->attributes['xml:id']) {
case "authors":
$prefix = bind_entities('&livedocs.author;');
break;
@@ -150,10 +150,10 @@
unset($cl[0]);
break;
default:
- $prefix = $node->attributes['id'];
+ $prefix = $node->attributes['xml:id'];
}
- return sprintf('<div class="group%s"><b>%s</b>%s %s%s</div>',
$node->attributes['id'], $prefix, $node->content, $l, implode(", ", $cl));
+ return sprintf('<div class="group%s"><b>%s</b>%s %s%s</div>',
$node->attributes['xml:id'], $prefix, $node->content, $l, implode(", ", $cl));
}
function format_copyright($node)
@@ -197,13 +197,15 @@
function format_name($node)
{
- $class = $node->parent->attributes['id'];
- foreach ($node->children as $child) {
- if ($child->tagname == 'firstname') {
- $firstname = $child->content;
- }
- if ($child->tagname == 'surname') {
- $surname = $child->content;
+ $class = $node->parent->attributes['xml:id'];
+ foreach ($node->children as $personname) {
+ foreach($personname->children as $child) {
+ if ($child->tagname == 'firstname') {
+ $firstname = $child->content;
+ }
+ if ($child->tagname == 'surname') {
+ $surname = $child->content;
+ }
}
}
switch ($class) {
@@ -250,13 +252,15 @@
global $lang;
$caption = $node->content;
+ $linkend = isset($node->attributes['xlink:href']) ?
$node->attributes['xlink:href'] : $node->attributes['linkend'];
+
if (strlen($caption) == 0) {
- $caption = lookup_title($node->attributes['linkend']);
+ $caption = lookup_title($linkend);
}
if (strlen($caption) == 0) {
- $caption = $node->attributes['linkend'];
+ $caption = $linkend;
}
- $url = generate_url_for_id($lang, $node->attributes['linkend']);
+ $url = generate_url_for_id($lang, $linkend);
$dir='';
if(isset($node->attributes['dir'])) {
$dir = ' dir="'.$node->attributes['dir'].'"';
http://cvs.php.net/viewvc.cgi/livedocs/xml_classes5.php?r1=1.12&r2=1.13&diff_format=u
Index: livedocs/xml_classes5.php
diff -u livedocs/xml_classes5.php:1.12 livedocs/xml_classes5.php:1.13
--- livedocs/xml_classes5.php:1.12 Tue Jun 21 01:38:05 2005
+++ livedocs/xml_classes5.php Mon Jun 25 12:38:08 2007
@@ -19,7 +19,7 @@
// | PHP 5 style |
// +----------------------------------------------------------------------+
//
-// $Id: xml_classes5.php,v 1.12 2005/06/21 01:38:05 iliaa Exp $
+// $Id: xml_classes5.php,v 1.13 2007/06/25 12:38:08 bjori Exp $
class Node { /* {{{ */
@@ -65,8 +65,8 @@
}
}
- if (isset($this->attributes['id'])) {
- $anchor = '<a name="'.$this->attributes['id'].'"></a>';
+ if (isset($this->attributes['xml:id'])) {
+ $anchor = '<a
name="'.$this->attributes['xml:id'].'"></a>';
} else {
$anchor = '';
}
@@ -116,7 +116,7 @@
function select_node($id)
{
- if (isset($this->attributes['id']) && $this->attributes['id']
== $id) {
+ if (isset($this->attributes['xml:id']) &&
$this->attributes['xml:id'] == $id) {
return $node;
}
/* look for children that match */