Parsing XML in php4

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alkazakov@gmail.com

    Parsing XML in php4

    I did the parsing XML and it works on my computer (PHP5), but as usual
    it doesn't on the clients server (PHP4) =)

    can you look into it:

    http://sfhousemusic.com/newlook/pasingXML.php - test file with this in
    it:

    <?php
    error_reporting (E_ALL);

    $doc = DOMDocument::lo adHTML("playlis t.xml");
    var_dump($doc);

    $aSongID = array();
    $aSongName = array();
    $aSongPath = array();

    $songs = $doc->getElementsByT agName("Song");

    foreach($songs as $song){
    array_push($aSo ngID, $song->getAttribute(" ID"));
    array_push($aSo ngName, $song->$song->nodeValue);
    array_push($aSo ngPath, $song->getAttribute(" URL"));
    }

    var_dump($aSong ID);

    ?>

    =(
    it just displays the blank page with no errors, so i can't figure out
    what is it.

    help needed...

    Thanks, Alexander =\

  • Darkstar 3D

    #2
    Re: Parsing XML in php4

    I guess you fixed it. IE & FF has content for me.

    Comment

    • samudasu

      #3
      Re: Parsing XML in php4

      PHP 5 uses the new Dom functions and PHP 4 uses old Dom Xml functions.
      DOMDocument->getElementsByT agName() is valid with PHP 5 and Dom
      functions.
      DomDocument->get_elements_b y_tagname is used with PHP4 and the Dom Xml.

      Either have your client upgrade to PHP 5 or you can load the Dom Xml
      functions from the pecl and code that way.

      PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


      Comment

      Working...