Hi,
I am trying to use the php5 's DOM extension but i am getting error.
The code I am trying to execute is:
<?php
$dom = new DOMDocument;
$dom->load("book.xml");
print "<pre>";
print $dom->documentElement->nodeName;
print "<br/>\n";
//does not work...
//print $dom->getElementsByTagName("book")[0];
print_r( $dom->getElementsByTagName("book"));
print "<br/>\n";
print htmlentities($dom->saveXML());
?>
This is an example I found. It gives error:
PHP Fatal error: Class 'DOMDocument' not found in /home/test.php on line 2
Any idea?
I am using php 5.0. Here is version output:
PHP 5.1.6 (cli) (built: Dec 15 2006 10:43:55)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
I am trying to use the php5 's DOM extension but i am getting error.
The code I am trying to execute is:
<?php
$dom = new DOMDocument;
$dom->load("book.xml");
print "<pre>";
print $dom->documentElement->nodeName;
print "<br/>\n";
//does not work...
//print $dom->getElementsByTagName("book")[0];
print_r( $dom->getElementsByTagName("book"));
print "<br/>\n";
print htmlentities($dom->saveXML());
?>
This is an example I found. It gives error:
PHP Fatal error: Class 'DOMDocument' not found in /home/test.php on line 2
Any idea?
I am using php 5.0. Here is version output:
PHP 5.1.6 (cli) (built: Dec 15 2006 10:43:55)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies