how to put xml file in website?
I would like to add content to my Joomla! site by using an .xml feed that is offered by a company that I am an affiliate of. The company has an .xml feed available so that affiliates can have the updates done automatically. I thought that I might be able to use the built in newsreader, but the tech support from the company has quickly informed me that an rss feed reader won't do the job. Though it seems to me that an rss feed reader esentially parses .xml?
Has anyone had any experience or advice with having Joomla! display the results of an .xml feed that is not rss?
<?xml version="1.0" encoding="utf-8" ?>
<videos>
<item>
<title>Raja Mahal</title><categories>Movies</categories><genre>Drama, Action & Adventure</genre><description>A Zamindar’s son working as an ordinary mill worker gives shelter to an escaped convict. The convict, however, dupes his benefactor and goes to the Zamindar’s place posing as the heir to the property. <br/><br/></description><vid>52585</vid><keywords>Drama, crime, thriller, stunts, revenge, Krishna, Vijaya Lalitha, Krishnam Raju, Telugu Movies, 70s movies, K.V. Chalam, Jyothi Lakshmi, Rama Kameswara, </keywords><duration>136.10</duration><embed><object width="425" height="355"><param name="movie" value="http://www.rajshritelugu.com/players/affplayer.swf?blogid=A6D70264-037C-453B-8A01-1089F183E5A7_1070&flashpath=http://www.rajshritelugu.com/"></param><embed src="http://www.rajshritelugu.com/players/affplayer.swf?blogid=A6D70264-037C-453B-8A01-1089F183E5A7_1070&flashpath=http://www.rajshritelugu.com/" type="application/x-shockwave-flash" width="425" height="355"></embed></object></embed><thumbnail>http://rajshri-c-18.vo.llnwd.net/d1/content/Telugu/Movies/52585.jpg</thumbnail>
</item>
<item>
<title>Bezawada Bebbuli</title><categories>Movies</categories><genre>Drama, Action & Adventure</genre><description>A righteous lawyer is killed when the thug he wants to expose kills him. One of his sons grows up to become a cop while the younger one becomes a criminal. </description><vid>52579</vid><keywords>Drama, suspense, thriller, revenge, comedy, humour, Krishna, Sri Priya, Radhika, Sivaji Ganesan, Satyanaryana, Sutti Verabhadra Rao, Shyamala Gouri, Sowcar Janaki, Mada, Sakshi Ranga Rao</keywords><duration>112.09</duration><embed><object width="425" height="355"><param name="movie" value="http://www.rajshritelugu.com/players/affplayer.swf?blogid=C53B4659-1E82-4152-82A7-5FBF162BDB66_1070&flashpath=http://www.rajshritelugu.com/"></param><embed src="http://www.rajshritelugu.com/players/affplayer.swf?blogid=C53B4659-1E82-4152-82A7-5FBF162BDB66_1070&flashpath=http://www.rajshritelugu.com/" type="application/x-shockwave-flash" width="425" height="355"></embed></object></embed><thumbnail>http://rajshri-c-18.vo.llnwd.net/d1/content/Telugu/Movies/52579.jpg</thumbnail>&开发者_如何学JAVAlt;/item>
</videos>
this is the url from i got this xml file from: http://www.rajshri.com/syndicate/?uid=1070&sig=b20aee5e1336fb1ffb4f520e67e89a75&lang=telugu&channel=movies
First off, an RSS reader does read XML. However it reads XML files that have a specific structure (RSS). The file source you show above is not in the RSS structure, so an RSS reader would not be able to understand it. A more general XML reader would be able to parse it for you, but you'd need to tell it what to do with the data (it wouldn't inherently know how you want the various elements placed on the page).
Joomla is built on PHP and has the capability to add in extensions and user-created code. Usually this conforms to the Model/Controller/View design principle, but if you create just one PHP page that fetches the XML, parses it with PHP's XML parser, and echoes out the content you want, you can install that into Joomla as a Component and have a menu item point to it, or install it as a Module and have it appear in the sidebar of another page.
If you don't want to deal with the internal workings of Joomla, you could have an outside script on your server (using PHP or another programming language) that captures the XML file from the remote server, parses it with its XML reader, and turns around and outputs the same content in an RSS-structured XML file. Then you could point Joomla's RSS reader at that external script that's acting as an interpreter of the data.
Or if your goal is to allow users to download the file from your website and do something else with it, either put a link in an Article to the file on a remote server, or install an extension like Phoca Download, which would allow your Joomla installation to host the file yourself and track the number of downloads and set security on the file.
Create a folder in your website called "XMLFiles". Create a file in that folder called "Videos.xml" and place your XML in the file.
Pick a programing language (e.g. Perl), pick an XML parsing library (e.g. XML::LibXML), read the data in, extract the bits you want (e.g. with DOM or XPath), then generate some HTML (e.g. with a templating language like TT2).
You could generate static files or use a web framework like CGI::Application or Catalyst.
精彩评论