XML to PHP

They have: 18 posts

Joined: Mar 2006

Hi All

I have simple XML code which I have used XSLT to output, both files are pasted below and the result can be seen at http://itsuite.it.brighton.ac.uk/pjgh1/birds.xml.
This was for experimental purposes, I now want to display the XML data on a PHP page but am incertain as to how, I have trawled the web and can't get my head round some of the solutions found as i loathe trying to unravel someone elses complicated, poorly explained code and tend to start daydreaming after about 3 seconds. Can anyone suggest a straightforward solution?

Many Thanks

Don Logan

'You'll just have to turn this opportunity YES'

BIRDS.XML
<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="birds.xsl" ?>

Golden oriole
Oriolus oriolus
Summer
9-42
85

Sparrowhawk
Accipiter nisus
Resident
34,500
0

Siskin
Carduelis spinus
Resident/Winter
310,000
0

Hoopoe
Upupa epops
Passage
Occasional
100

BIRDS.XSL
<?xml version="1.0" encoding="ISO-8859-1" ?>

British Birds

SpeciesLatinStatus
BreedingPassagemore info

breeding pairs

birds

more...

dk01's picture

He has: 516 posts

Joined: Mar 2002

I use the php functions listed here (from the PHP XML DOM). Basically all of the pages in the left hand column will be helpful in retrieving your xml data in php.
http://www.topxml.com/php_xml_dom/default.asp

I also use these from the php.net site:
http://us3.php.net/manual/en/ref.domxml.php

Unfortunately since both php and xml are very versatile coding between them is unique for each php application and indeed each xml file. You will need to use these functions to access you data and navigate your xml file with php.

-dk

They have: 18 posts

Joined: Mar 2006

Cheers

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.