#29684 [Opn->Bgs]: Error loading XML or XSL files with DomXML
| From: | amt@php.net | Date: | Sun, 15 Aug 2004 02:35:18 +0000 |
| Subject: | #29684 [Opn->Bgs]: Error loading XML or XSL files with DomXML | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64623@lists.php.net to get a copy of this message | ||
ID: 29684
Updated by: amt@php.net
Reported By: powerblade at mail dot dk
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: Windows XP
PHP Version: 5CVS-2004-08-15 (dev)
New Comment:
Have you tried using the load() method instead of
loadXML()? DomDocument::loadXML() is for XML from a
string, while load() is from a file. You're trying to
parse the string 'example.com'
Previous Comments:
------------------------------------------------------------------------
[2004-08-15 00:52:21] powerblade at mail dot dk
Description:
------------
PHP simply won't load the XML file.
Whenever it loads the file, it seems like it empties it out.
I think they have the same problem here:
http://mail.gnome.org/archives/xml/2001-June/msg00153.html
Reproduce code:
---------------
index.php:
<?php
$oXML = new domdocument();
$oXML->loadXML('example.xml');
echo "done...";
?>
example.xml:
<?xml version="1.0" encoding="UTF-8"?>
<topic subject="Topic subject" tid="1">
<posts>
<post pid="1" mid="1" cdate="01-02-2003"
mdate="05-04-2004"
username="PowerBlade">
Blah blah blah
</post>
</posts>
</topic>
Expected result:
----------------
done...
Actual result:
--------------
Warning: DOMDocument::loadXML() [function.loadXML]: Start tag expected,
'<' not found in Entity, line: 1 in W:\Apache2\htdocs\test\index.php on
line 5
done...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29684&edit=1