tags:

views:

37

answers:

2

I have installed xampp 1.7.3 and the php version is PHP 5.3.1.When iam using the function domxml_open_file() ,it throwing an error Call to undefined function domxml_open_file().

How i can enable DOM in php.Thanks in advance.

I canot find 'extension=php_domxml.dll' in php.ini file, so i added extension=php_domxml.dll this in php.ini file

A: 

check phpinfo() if php was compiled with --with-libxml-dir

stillstanding
can u explain more
THOmas
libxmllibXML support activelibXML Compiled Version 2.7.6libXML Loaded Version 20706libXML streams enabled
THOmas
@stillstanding `DOMXML` is not `DOM`. For DOMXML, PHP has to be configured `--with-DOM` at a minimum.
Gordon
since you have libxml installed, use this instead:`$doc=new DOMDocument;``$doc->load($file);`
stillstanding
+2  A: 

DOMXML is the old PHP4 XML extension and no longer bundled with PHP5. You have to get it from PECL:

This » PECL extension is not bundled with PHP. Information for installing this PECL extension may be found in the manual chapter titled Installation of PECL extensions. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: » http://pecl.php.net/package/domxml.

Note that A DLL for this PECL extension is currently unavailable.

PHP5 features a new DOM extension, which (among others) should be available out of the box:

$dom = new DOMDocument;

Have a look at some of my previous answers involving DOM usage and also see this article on DevZone for an overview of the available XML extensions in PHP5.

Gordon
is their any equivalent function in php5
THOmas
@THOmas like I said: there is [DOM and many others](http://ua2.php.net/manual/en/refs.xml.php) to pick from. You might like [SimpleXml](http://ua2.php.net/manual/en/book.simplexml.php).
Gordon