DOM Load function

From: Date: Wed, 23 Nov 2011 09:10:12 +0000
Subject: DOM Load function
Groups: php.xml.dev 
Request: Send a blank email to [email protected] to get a copy of this message
I have issues with the DOM LOAD function. I CANNOT find the reason why it doesn't fill the Document with the xml file content:

$xmldoc = new DOMDocument();
$xmldoc->load("data/slides.xml");

In debugging, I can see the creation of a DOMDocument but the load function return True (1) and a empty Document $xmldoc:

<?xml version="1.0" encoding="UTF-8"?>
<album>
        <slide url="data/327.jpg" rel_URL="show_craft.php?id=327" title="Art. 327"></slide>
        <slide url="data/330.jpg" rel_URL="show_craft.php?id=330" title="Art. 330"></slide>
        <slide url="data/311.jpg" rel_URL="show_craft.php?id=311" title="Art. 311"></slide>
        <slide url="data/239.jpg" rel_URL="show_craft.php?id=239" title="Art. 239"></slide>
        <slide url="data/275.jpg" rel_URL="show_craft.php?id=275" title="Art. 275"></slide>
        <slide url="data/IMG_2691.jpg" rel_URL=" " title="Art. IMG_2691"></slide>
        <slide url="data/IMG_2684.jpg" rel_URL=" " title="Art. IMG_2684"></slide>
        <slide url="data/crafts 023.jpg" rel_URL=" " title="Art. crafts 023"></slide>
</album> I use XAMPP 1.7.7. In php.net, under DOMDocument::load page, there is a post that says "Function will not work if using XML DOM PECL module". In my phpinfo() there is only the "PECL Module version 2.0-dev $Id: sqlite.c 306939 2011-01-01 02:19:59Z felipe $ " under SQLite section enabled. I tried many things like changing xml path, replacing the xml file with a simpler one from, for example, w3schools but with no avail. I still get an empty document and no errors. I don't know where to bang my head since it looks like it's only me having this issue (search the web extensively). Any help is greatly appreciated. Thank you * English - detected * Albanian * Dutch * English * French * German * Italian * Spanish * Albanian * Dutch * English * French * German * Italian * Spanish <javascript:void(0);>

Thread (1 message)

  • mcberta2
« previous php.xml.dev (#635) next »