XML Data into HTML or PHP?
Posted: Thu Aug 13, 2009 4:29 am
Hi all, my first post...
I am trying to create an HTML version of my Flash website as easily as possible. My Flash website uses external XML for the content so ideally it would be great if I can use that same XML data in an SEO friendly HTML or PHP website. Obviously this means I have to keep the structure of the existing XML so that I can make edits to the XML and this would update both my Flash and HTML/PHP websites.
An example of the XML code (for my gallery):
[/color]
And my HOME page:
[/color]
So, how can I achieve this? I have Googled the hell out of this but cannot seem to find a straightforward solution. I seem to remember seeing somewhere that I'd have to use JS and PHP to get the XML content displayed in a webpage, but it wasn't remotely clear how to actually do that...
Could anyone please help?
I am trying to create an HTML version of my Flash website as easily as possible. My Flash website uses external XML for the content so ideally it would be great if I can use that same XML data in an SEO friendly HTML or PHP website. Obviously this means I have to keep the structure of the existing XML so that I can make edits to the XML and this would update both my Flash and HTML/PHP websites.
An example of the XML code (for my gallery):
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<gallery> <img>
<title>G1 Image One</title>
<description>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus id lectus. Duis turpis dui, id, rutrum sed.</description>
<tmb>images/Master 135 x 91.jpg</tmb>
<image>images/Master 824 x 554.jpg</image>
</img><img>
<title>G1 Image One</title>
<description>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus id lectus. Duis turpis dui, id, rutrum sed.</description>
<tmb>images/Master 135 x 91.jpg</tmb>
<image>images/Master 824 x 554.jpg</image>
</img><img>
<title>G1 Image One</title>
<description>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus id lectus. Duis turpis dui, id, rutrum sed.</description>
<tmb>images/Master 135 x 91.jpg</tmb>
<image>images/Master 824 x 554.jpg</image>
</img> </gallery>
<title>YOUR GALLERY</title>And my HOME page:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<title>My Website</title>
<text>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed mi vitae lacus ornare tristique. Fusce accumsan leo sagittis lectus. Aenean ornare erat malesuada ligula imperdiet imperdiet. Nunc iaculis faucibus quam. Maecenas porta dapibus ligula. Vestibulum mollis adipiscing lacus. Etiam pharetra elementum tortor. In hac habitasse platea dictumst. Curabitur turpis pede, mollis vel, fringilla ac, accumsan id, tortor. Maecenas porta dapibus ligula. Vestibulum mollis adipiscing lacus. Etiam pharetra elementum tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras pretium placerat neque. </text>
<image>images/Master 824 x 554.jpg</image>
<logo>images/logo.png</logo>So, how can I achieve this? I have Googled the hell out of this but cannot seem to find a straightforward solution. I seem to remember seeing somewhere that I'd have to use JS and PHP to get the XML content displayed in a webpage, but it wasn't remotely clear how to actually do that...
Could anyone please help?