I don’t know why I’m having so much trouble with this, but I need to use a single XML file as a reference for parsing data. I am using XML instead of MySQL here for server limitation reasons.
Say this is my basic XML structure:
[CODE]<journal id=”11″>
<name>Journal 1 Title</name>
<url>http://www.journal1.com</url>
</journal>
<journal id=”127″>
<name>Journal 2 Title</name>
<url>http://www.journal2.com</url>
<coverImage>journal2coverimage.jpg</coverImage>
</journal>
On a website, I would like to use this data following this model:
[code=html]<a href=”<?php print getURL(11); ?>”><?php print getName(11); ?><img src=”<?php print getCoverImage(11); ?>” alt=”<?php print getName(11); ?>”></a>
This code would ideally pull form the XML document the title, cover image, and URL link for Journal 1.
I need functions that can parse my XML file (journals.xml) and return the appropriate values with the three functions in the HTML code above. I am so lost. Any advice?