473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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/phpinfo.php
http://sfhousemusic.com/newlook/pasingXML.php - test file with this in
it:

<?php
error_reporting(E_ALL);

$doc = DOMDocument::loadHTML("playlist.xml");
var_dump($doc);

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

$songs = $doc->getElementsByTagName("Song");

foreach($songs as $song){
array_push($aSongID, $song->getAttribute("ID"));
array_push($aSongName, $song->$song->nodeValue);
array_push($aSongPath, $song->getAttribute("URL"));
}

var_dump($aSongID);

?>

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

help needed...

Thanks, Alexander =\

Feb 9 '06 #1
2 2247
I guess you fixed it. IE & FF has content for me.

Feb 9 '06 #2
PHP 5 uses the new Dom functions and PHP 4 uses old Dom Xml functions.
DOMDocument->getElementsByTagName() is valid with PHP 5 and Dom
functions.
DomDocument->get_elements_by_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.

http://de.php.net/manual/en/ref.domxml.php

Feb 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tim Tyler | last post by:
I'm sure this is a FAQ - but I could not find a coherent statement of the answer: Some of my clients want PHP4. Other ones want PHP5. Can I run both PHP4 and PHP5 under the same instance of...
1
by: dev | last post by:
Hey all, i am a newbie with xsl&xml parsing i have a xml doc and i try to make axsl and parse it to webbrowser.. how must i do that? in php just include xml file or must i parse it to a...
0
by: yawnmoth | last post by:
Say I have the following script: <?php $contents="<p>test\ntest</p>"; $xml_parser = xml_parser_create('UTF-8'); // try xml_parser_create_ns, too....
2
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
2
by: thomas | last post by:
hey everybody, does anyone know a good internet page where I can found some examples how to parse xml files by php..... all the pages I found give me too little information, so I was not able...
12
by: Drazen Gemic | last post by:
How long will PHP4 be supported ? When is PHP4 end of life scheduled ? DG
1
by: Randell D. | last post by:
Folks, I consider myself well versed with Apache 1.3 and PHP4 - I found drupal and wanted to try it out - I had problems getting it working with Apache2/PHP5/MySQL5 so I downgraded... Note: I...
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
8
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.