Miguel J. Jiménez wrote:
Hi, after enabling error reporting with E_ALL I am having this strange
warning while loading a XML:
Warning: DOMDocument::load() [function.DOMDocument-load]: Extra content
at the end of the document in [...]
The code I use is:
$dom = new DOMDocument();
$dom->load("http://example.com/file.xml");
[...]
If I open the xml uri (with firefox) I get a complete and well formed
xml (nothing strange about it).
With error reporting disabled everything works fine so I am
puzzled :-( Any help will be appreciated.
---
.---------------------------------------------------------.
| Miguel J. Jiménez |
| Sector Público, ISOTROL S.A. |
| mjjimenez@xxxxxxxxxxx |
:---------------------------------------------------------:
| KeyID 0xFFE63EC6 hkp://pgp.rediris.es:11371 |
:---------------------------------------------------------:
| Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta. |
| Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP). |
| Tlfn: +34 955 036 800 (ext.1805) - Fax: +34 955 036 849 |
| http://www.isotrol.com |
:---------------------------------------------------------:
| UTM ED-50 X:765205.09 Y:4144614.91 Huso: 29 |
:---------------------------------------------------------:
| "Oh no, Number One. I'm sure most will be much more |
| interesting. Let's see what's out there. Engage." |
| Capt. Jean-Luc Picard |
| Star Trek TNG (1x01, Encounter At Farpoint) |
'---------------------------------------------------------'
check raw the file output by doing:
print_r(file_get_contents("http://example.com/file.xml"));
that should show you exactly what's causing the error.
another possibility is that the site has bot protection on there and is
redirecting your request to a standard web page.
Alternatively pass the url to the XML file to me and I'll investigate
for you.
Nathan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php