File: bind-atom.php

package info (click to toggle)
php-structures-datagrid 0.9.3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 408 kB
  • ctags: 876
  • sloc: php: 2,576; xml: 222; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

require_once 'Structures/DataGrid.php';    

// Create the datagrid
$datagrid =& new Structures_DataGrid();

// Use XPath and namespace to extract Atom entries
$options = array(
    'namespaces' => array('atom' => 'http://www.w3.org/2005/Atom'),
    'path'       => '//atom:entry'
);
$feed = 'http://www.php.net/feed.atom';
$test = $datagrid->bind($feed, $options, 'XML');
if (PEAR::isError($test)) {
    exit($test->getMessage()); 
}

// Render the feed as a table
$datagrid->render();

?>