SimpleXML error

From: Date: Mon, 26 Nov 2007 21:44:14 +0000
Subject: SimpleXML error
Groups: php.general 
Request: Send a blank email to php-general+get-265037@lists.php.net to get a copy of this message
Hey all, I have some XML files I need to parse and then display (they have HTML formatting in them as well). They contain the following: <?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//Gale//DTD Gale eBook Document DTD 20031113//EN" "galeeBkdoc.dtd"> <html gale:versionNumber="OEB 1.2, Gale 1.3"> <head> <gale:docName gale:zzNumber="2536600565"/> <gale:documentCitation> <gale:pageRange>214-215</gale:pageRange> </gale:documentCitation> <title>Thomas Jefferson and the Revision of the Virginia Laws</title> </head> I am then attempting to extract the title with this: $xml = simplexml_load_file(BASE_DIR.'/content/'.$r['filename']); $title= $xml->title; But in the browser I get the following warning. namespace error : Namespace prefix gale for versionNumber on html is not defined... Is this because it is not locating the file galeeBkdoc.dtd, which defines all the elements in the XML files? It is located in the same directory as the content. I have also tried putting the complete path via HTTP in with the name of the DTD file with no luck. Suggestions would be greatly appreciated. Thanks! Skip -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison, WI 53703 608-250-2720 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL, AJAX & DHTML development framework. http://phpenguin.bigskypenguin.com/

« previous php.general (#265037) next »