SimpleXML and ADO XML



I've spent an hour trying to make SimpleXML work until I realized the
problem seems to be namespaces. This code:

<?php
$xml = simplexml_load_file('foo.xml');
print_r($xml);
?>

works fine, unless the XML file contains tags with colons, e.g.:

<rs:data>

In this case, I get an empty object. What am I missing?


I need to parse third-party XML files. I believe it's ADO XML:

http://www.devarticles.com/c/a/XML/Displaying-ADO-Retrieved-Data-with-XML-Islands/2/



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
.



Relevant Pages

  • Re: SimpleXML and ADO XML
    ... problem seems to be namespaces. ... works fine, unless the XML file contains tags with colons, e.g.: ... I tried the XMLReader extension with sample code taken from a user ... note in the PHP manual and I got it working in a few minutes, ...
    (comp.lang.php)
  • Re: How to insert UTF8 into mysql from PHP
    ... It works correctly for ascii text in XML file but not for non-ascii ones. ... If $insert is written to a file (using fwrite in PHP), the characters are correct. ...
    (comp.lang.php)
  • Re: The wonderful non-intuitive php include statement
    ... The database configuration is an XML file. ... I am using apache which has php set up as a module. ... Important to remember is that the current working directory normally is the path of the script that got started by the request, and will NOT change in other included files. ...
    (comp.lang.php)
  • Re: creating XML with embedded PHP
    ... >me to embed PHP into an xml file like I would do to an HTML file in order to ... however the apache server does not realize that it's PHP ... Depends whether you count this as "modifying" the server, ...
    (comp.lang.php)
  • Re: The wonderful non-intuitive php include statement
    ... The database configuration is an XML file. ... I am using apache which has php set up as a module. ... main.php which resides in htdocs. ...
    (comp.lang.php)