How to load a Zend-generated XML file into a PHP script?

JayZ

New Member
I have a content management system (Omeka) which is built on the Zend framework. There's pages on the site which have different output options such as XML and JSON. I'm able to validate the output from the site. And when I save the XML files as a .xml file on my server, my code is able to load it. But when I reference the URL of the XML file generated by the script, the PHP returns an error. Although it returns a 404, I can put the URL I'm trying to load into my browser and I will see the proper XML page. The script I'm loading: http://lw4.gc.cuny.edu/_dev_push/archive/items/show/1?output=omeka-xml.Here is the code I'm using to try and load the files. I'm just trying a series of methods to see if any of them work. I'd prefer to use the SimpleXML method if it can be done:\[code\] $xml = simplexml_load_file('http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml'); $doc = new DOMDocument(); $doc->loadXML('http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml'); echo $doc->saveXML(); $str = file_get_contents('http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml'); echo $str; \[/code\]Here are the errors that my script returns when I type in the exact URL of the dynamically generated XML page. \[quote\] Warning: simplexml_load_file(http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/html/_dev_push/wp-content/plugins/omekafeed/omekafeed.php on line 122 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml" in /var/www/html/_dev_push/wp-content/plugins/omekafeed/omekafeed.php on line 122 Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 in /var/www/html/_dev_push/wp-content/plugins/omekafeed/omekafeed.php on line 124 Warning: file_get_contents(http://lw4.gc.cuny.edu/_dev_push/archive/items/show/id/1?output=omeka-xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/html/_dev_push/wp-content/plugins/omekafeed/omekafeed.php on line 127\[/quote\]The scripts do load when I specify the URLs in this fashion. Note that in this case text3.xml isn't generate dynamically with a script, but it is identical to the xml file called in the previous example. \[code\] $xml = simplexml_load_file('http://lw4.gc.cuny.edu/_dev_push/archive/test3.xml'); $doc = new DOMDocument(); $doc->loadXML('http://lw4.gc.cuny.edu/_dev_push/archive/test3.xml'); echo $doc->saveXML(); $str = file_get_contents('http://lw4.gc.cuny.edu/_dev_push/archive/test3.xml'); echo $str;\[/code\]There are no passwords protecting the part of the site I'm using. I'm working on the same domain, although it's worth pointing out that I'm trying to pull the XML content from a separate content management system into another one [that is in a subdirectory of the first one]. As I can get these scripts to work when I specify a hardcoded, but identical XML file, my suspicion is that it is the fact that the dynamic XML files are generated by Zend which is the problem, but I couldn't find any reference to this feature, or how to change it.What do you think, what can I do to make this content load so I can parse it with my PHP script?
 
Back
Top