2-4-3.php(P131)
15: print '<dl><dt>';
16: // RSSフィードのタイトルを出力
17: $title = $xpath->query("/rdf:RDF/rss:channel/rss:title/text()")
18: ->item(0)->textContent;
19: $link = $xpath->query("/rdf:RDF/rss:channel/rss:link/text()")
20: ->item(0)->textContent;
21: printf('<b><a href="%s" target="blank">%s</a></b>',
22: $link, $title);
23: // RSSフィードの概要説明を出力
24: $description =
25: $xpath->query("/rdf:RDF/rss:channel/rss:description/text()")
26: ->item(0)->textContent;
27: print '</dt><dd>'.$description.'</dd>';
2-4-4.php(P133)
14: print '<dl><dt>';
15: // Atomフィードのタイトルを求める
16: $title = $xpath->query("/atom:feed/atom:title/text()")
17: ->item(0)->textContent;
18: // <link rel='alternate'>という要素を求める
19: $link = $xpath
20: ->query("/atom:feed/atom:link[@rel='alternate']")
21: ->item(0);
22: // Atomフィードのタイトルを出力
23: if($link){
24: // Atomフィードの代替URIを求める
25: $href=$link->attributes->getNamedItem('href')->textContent;
26: printf('<dt><b><a href="%s" target="blank">%s</a></b></dt>',
27: $href, $title);
28: }else{
29: printf('<dt><b>%s</b></dt>', $title);
30: }
31:
32: // Atomフィードのサブタイトルを出力
33: $subtitle = $xpath->query("/atom:feed/atom:subtitle/text()")
34: ->item(0)->textContent;
35: if($subtitle){
36: print '</dt><dd>'.$subtitle.'</dd>';
37: }
3-7-1.php(P278)
23: // 各Result要素を出力
24: print("<dl>");
25: foreach ($results as $result){
26: if( $result->nodeType != XML_ELEMENT_NODE) {continue;}
27: $title = $result->getElementsByTagName('Title')
28: ->item(0)->textContent;
3-7-2.php(P280)
23: // 各Result要素を出力
24: print("<table><tr>");
25: foreach ($results as $key => $result){
26: if( $result->nodeType != XML_ELEMENT_NODE) {continue;}
27: $title = $result->getElementsByTagName('Title')
28: ->item(0)->textContent;