Extracting certain information from an XML file

add error_reporting(E_ALL)

Okay, I talked to my host and she told me how to use PHP5 on my server so I was able to use the built-in SimpleXML (thank god, because the code is so much simpler). Here’s my code:

[code]<?php
echo error_reporting(E_ALL);

$xml = file_get_contents(‘http://wowarmory.com/character-talents.xml?r=Hydraxis&n=Nicora’);

$page = simplexml_load_file(’$xml’);

echo $page->characterInfo->talentTab->talentTree[‘value’];

?>[/code]

And it outputs this: 6143 (for the error code)
http://wow.wolfdragon.net/simple-test.php5

[php]<?php
error_reporting(E_ALL);

$xml = file_get_contents(‘http://wowarmory.com/character-talents.xml?r=Hydraxis&n=Nicora’);

$page = simplexml_load_file(’$xml’);

echo $page->characterInfo->talentTab->talentTree[‘value’];

?>[/php]

but i cant see the page http://wowarmory.com/character-talents. … s&n=Nicora having infos in characterInfo->talentTab->talentTree.
it a xhtml page.

So…I’m using the wrong script?

i think u are using the wrong xml file.

I think you’re right. It seems that as the script is bringing the XML file in, it somehow becomes HTML. So, instead of parsing XML, I need to be parsing HTML. Back to the drawing board. I’ll look for some scripts for that on my own but any suggestions you have would be really appreciated.

it’s xhtml.
xhtml is xml as well.
u may use that script u have.

just adjust the location u are looking at. $page->body->…

Sponsor our Newsletter | Privacy Policy | Terms of Service