| | |
Is it possible to code inside XML file for an RSS Feed?
Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2007
Posts: 66
Reputation:
Solved Threads: 0
Hello guys,
I need an expert advice if it is possible to code inside an XML file? Example, news.xml whereas in that file you have to code connecting to MySQL database then retrieve data. Generated data is the XML required tags for the RSS and will be written in similar file that is the news.xml.
All I know is, an XML file only contains XML tags and no coding. Any idea please share. Thank you very much.
GIO
I need an expert advice if it is possible to code inside an XML file? Example, news.xml whereas in that file you have to code connecting to MySQL database then retrieve data. Generated data is the XML required tags for the RSS and will be written in similar file that is the news.xml.
All I know is, an XML file only contains XML tags and no coding. Any idea please share. Thank you very much.
GIO
Hi. You can use this in your htaccess file
It redirects news.xml to news.php.
In news.php you can use:
to state that your output will be xml. After this, just output your generated tags.
Sorry for the late reply, I've been away.
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
RewriteRule ^news.xml$ "news.php" [L]
It redirects news.xml to news.php.
In news.php you can use:
php Syntax (Toggle Plain Text)
header("Content-Type: application/xml; charset=ISO-8859-1");
to state that your output will be xml. After this, just output your generated tags.
Sorry for the late reply, I've been away.
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
Hi,
Pritaeas solution is neat but does rely on Apache MOD_REWRITE being enabled, which is not always the case.
Another way to do it is to request the worker page (eg. news.php) directly and specify any content criteria in the query part of the url.
For example
http://www.blah.domain/feeds/news.php?s=fashion&d=5&c=france
The values s, d, c would be entirely of your own choosing (I just invented these ones) and would be interpreted server-side from $_GET in PHP (or ASP, JSP etc) to compose corresponding SQL, perform the database lookup, and finally compose and serve the output XML (or HTML or whatever is your final product).
Some RSS feeds are served this way, eg,
http://www.blog.nl/rss.php?blogId=17&profile=rss20
http://www.stern.de/standard/rss.php?channel=sport-motor
though it is more common to find path-mapped urls eg.;
http://www.pheedo.com/f/newscientist_motoring-tech
Airshow
Pritaeas solution is neat but does rely on Apache MOD_REWRITE being enabled, which is not always the case.
Another way to do it is to request the worker page (eg. news.php) directly and specify any content criteria in the query part of the url.
For example
http://www.blah.domain/feeds/news.php?s=fashion&d=5&c=france
The values s, d, c would be entirely of your own choosing (I just invented these ones) and would be interpreted server-side from $_GET in PHP (or ASP, JSP etc) to compose corresponding SQL, perform the database lookup, and finally compose and serve the output XML (or HTML or whatever is your final product).
Some RSS feeds are served this way, eg,
http://www.blog.nl/rss.php?blogId=17&profile=rss20
http://www.stern.de/standard/rss.php?channel=sport-motor
though it is more common to find path-mapped urls eg.;
http://www.pheedo.com/f/newscientist_motoring-tech
Airshow
50% of the solition lies in accurately describing the problem!
![]() |
Similar Threads
- rss php feed not working or validating (RSS, Web Services and SOAP)
- create html file from rss feed (PHP)
- XML file not found for parser? (Java)
- Xpath navigation in xml file (XML, XSLT and XPATH)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: Need help on restful web service
- Next Thread: RSS feeds to PDF
| Thread Tools | Search this Thread |
.htaccess 301 accept alltop api authentication binarysecuritytoken blog card city collaboration country credit data development ebay email evernote flash google government highrise htaccess intel internet ip legal live location patent paypal php podcast proxy redirect rss rssfeeds searchmonkey server soap software swappingxmlfromflash swappingxmlnodes url web webservices webservicesecurity wiki wikipedia xml xslt y!os yahoo ydn





