www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] problem with simpleXML

  1. #1
    Join Date
    May 2007
    Posts
    126

    resolved [RESOLVED] problem with simpleXML

    Hi there,

    I am trying to make this little bit of code work
    PHP Code:
    $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.
    Code:
    object(SimpleXMLElement)#1 (0) { }
    I can't understand why my variable is empty... Any help?

    Thanks

  2. #2
    Join Date
    May 2007
    Posts
    126
    Never mind - Just found the error. It was in the xpath query...

    Sorry.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles