I could use SAX parse XML normally.But DOM failed. Even i can't open XML file with DOM.
if(!$dom = domxml_open_file("data.xml")) { echo "Error while parsing the document\n"; exit; }
who can help me?
Is DOM XML even enabled on the server you are trying to do it on?
yes.
my phpinfo()
domxml DOM/XML enabled DOM/XML API Version 20020815 libxml Version 20507 HTML Support enabled XPath Support enabled XPointer Support enabled DOM/XSLT enabled libxslt Version 1.0.23 libxslt compiled against libxml Version 2.4.28
Is this right?
Hi,
ya you can parse XML file with DOM in PHP.
I don't know for which OS you are trying this. I did it for windows2k with IIS.
Here are the steps :
1> Copy libxml2.dll and iconv.dll to c:\winnt\system32 folder 2> Copy php_domxml.dll to C:\PHP\extensions directory. 3> Uncomment the dynamic link module in your php.ini settings for php_domxml.dll. 4> Restart your IIS.
Note: 1> You can get libxml2.dll and iconv.dll from http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/docbooksys/segmentedhtml/ch03s03.html
2> You can get php_domxml.dll from http://kromann.info/php4.php
Hope this will help you.
Cheers 🙂 Shailesh