Jump to content

Stuck trying to open url for xml parsing


jkmcgrath

Recommended Posts

Hi,

 

I can open this link int i.e.7 http://69.42.56.202:27012/ARCALive?id=livedata and it returns xml.

 

If you notice, the root has a "-". I can save the page as xml and the "-" is gone and it passes xml validation.

 

Now when I try to open that same url with by any other means it times out. I have tried, fopen and DOM load and loadxml but nada. I can open it from a saved xml file but not by the url provided.

 

I am really stuck and have exhausted searching on google, php and here as well. My biggest problem is that I just dont know what method I need to use.

 

Thanks in Advance,

John

Follow his suggestion and if your talking about the"-" provided in the screen shot, that's not actually in the document, browsers just add that for the possibility to collapse elements for easier reading of XML Documents

 

[attachment deleted by admin]

Works fine

<?php

print_r( simplexml_load_string( file_get_contents("http://69.42.56.202:27012/ARCALive?id=livedata") ) );

?>

 

Thanks for the quick replies!

 

Man what am I doing wrong?

 

Here is the link http://mcfastracing.com/simxml.php

 

I just cut and pasted your code like so;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php

print_r( simplexml_load_string( file_get_contents("http://69.42.56.202:27012/ARCALive?id=livedata") ) );

?>
</body>
</html>

 

And I get this;

Warning: file_get_contents(http://69.42.56.202:27012/ARCALive?id=livedata) [function.file-get-contents]: failed to open stream: Connection timed out in /home/mcfastra/public_html/mcfastracing.com/simxml.php on line 11

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.