Click to See Complete Forum and Search --> : [RESOLVED] problem with simpleXML


r0k3t
07-31-2008, 12:35 PM
Hi there,

I am trying to make this little bit of code work

$string = <<<XML
<blogEntries xmlns:blog="http://locahost/docs/">
<blog:entry>
<blog:title>Sencond main test</blog:title>
<blog:topic>other</blog:topic>
<blog:subTopic>just another test to see what happens</blog:subTopic>
<blog:author>kenn</blog:author>
<blog:date>2008-07-30</blog:date>
<blog:text>This is another test to see what happens. I wonder what it does if I put in some HTML &lt;BR&gt;&lt;BR&gt;

I don't know if it will screw it up!

LA LA LA

</blog:text>
</blog:entry>
</blogEntries>
XML;


$xml = new SimpleXMLElement($string);
var_dump($xml);



however no matter what when I do a var_dump I get this.

object(SimpleXMLElement)#1 (0) { }


I can't understand why my variable is empty... Any help?

Thanks

r0k3t
07-31-2008, 12:40 PM
Never mind - Just found the error. It was in the xpath query...

Sorry.