Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-23-2004, 03:16 PM
WebProWorld Pro
 

Join Date: Aug 2004
Location: Maryland
Posts: 219
webmasterjunkie RepRank 0
Default XML & HTML

Does anyone know how to get an html page to display data from an xml file?
Reply With Quote
  #2 (permalink)  
Old 09-23-2004, 06:07 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default XML files with XSLT formatting

Internet Explorer 6 does display XML files, but on its own, it doesn't have the ability to present fully formatted pages.
If you add an XSLT stylesheet into the equation you will see the data held in the XML file displayed in a more conventional manner.

Check out the examples below:

The XML
The XSLT stylesheet
The XML file with an XSLT stylesheet
The XML file with a tree view stylesheet

Paul
Reply With Quote
  #3 (permalink)  
Old 09-23-2004, 07:19 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Are we talking 'data islands'?
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #4 (permalink)  
Old 09-23-2004, 07:22 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Also, you can use javascript to pull data, as well as php. Just parsing through at the moment, but if you want, we can get more info.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #5 (permalink)  
Old 09-24-2004, 10:28 AM
WebProWorld Pro
 

Join Date: Aug 2004
Location: Maryland
Posts: 219
webmasterjunkie RepRank 0
Default Display XML data

I have an xml rss feed that I have the xml source for, but I don't know how to get it to "feed". I have performed 10-20 searches on the net to try to find some code, but I can't find anything.

My server has the ability for MySQL, PHP, ASP, CF & PERL.
Reply With Quote
  #6 (permalink)  
Old 09-24-2004, 01:12 PM
WebProWorld New Member
 

Join Date: Oct 2003
Location: Delaware, US
Posts: 13
n2links RepRank 0
Default RSS Parser

You might want to look at http://magpierss.sourceforge.net/. This is a PHP class that will let you display the code from all RSS versions including Atom. Free and effective.
__________________
Jim Gray
http://quikonnex.com
Publishing without Email!
Reply With Quote
  #7 (permalink)  
Old 09-24-2004, 01:15 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Parsing XML files to produce HTML

Quote:
Originally Posted by webmasterjunkie
I have an xml rss feed that I have the xml source for, but I don't know how to get it to "feed". I have performed 10-20 searches on the net to try to find some code, but I can't find anything.

My server has the ability for MySQL, PHP, ASP, CF & PERL.
For that you'll need some means of parsing the XML files before they can be displayed as HTML. You can use any of the above server side programming languages you've listed. The actual implementation varies according to the choice of language/programming environment. If you check out the Programming Resources you'll see links to RSS parsers. One of the better ones is the MagpieRSS parser and that uses PHP. Microsoft have their own MSXML component that can be used in conjunction with ASP (if you need specific code for an ASP script I can help). There are many more out there.. just Google for "RSS parsers".

Paul
Reply With Quote
  #8 (permalink)  
Old 09-24-2004, 01:35 PM
WebProWorld New Member
 

Join Date: Sep 2004
Location: Cambridge
Posts: 1
rkirby RepRank 0
Default turning XML into HTML

XSLT is a great way of turning XML into HTML.

The problem is that you need to write some code to do the translation.

If you are using IIS as your webserver, it might be worth looking at Gnomon (http://gnomon.npsl.co.uk). It's Open source (so free), and provides a very neat way to apply XSLT to XML and send HTML back to the browser. XSLT is easy to learn and very flexible for this kind of work.
Reply With Quote
  #9 (permalink)  
Old 09-24-2004, 02:46 PM
WebProWorld New Member
 

Join Date: Oct 2003
Location: Delaware, US
Posts: 13
n2links RepRank 0
Default turning XML into HTML

XSLT files are great, but with an RSS feed, how do you handle the HTML that may be contained in <description> elements. My experiences is that and XML RSS feed using XSLT will render an HTML page with raw HTML code displayed. If there's something that can be done with an XSLT to allow the HTML to come through as well, then you've sold me!
__________________
Jim Gray
http://quikonnex.com
Publishing without Email!
Reply With Quote
  #10 (permalink)  
Old 09-24-2004, 04:06 PM
WebProWorld Pro
 

Join Date: Aug 2004
Location: Maryland
Posts: 219
webmasterjunkie RepRank 0
Default Code Snippets

I really like that magpierss site. I spent a little over an hour there. I just don't see why site don't give you the whole code, just those darn little snippets. AAHHH!

I guess why give away all of your hard work. Anyway, maybe I should be a little more clear, my username should be "webjunkie" as opposed to "web'master'junkie". I need to see some code of a page to see how it was done. Does that make sence?
Reply With Quote
  #11 (permalink)  
Old 09-24-2004, 05:13 PM
WebProWorld New Member
 

Join Date: Oct 2003
Location: Delaware, US
Posts: 13
n2links RepRank 0
Default

With Magpie:
PHP Code:
Code:
<?php

define('MAGPIE_DIR', '/path/classes/magpie/');
//define('MAGPIE_CACHE_ON', 0);
require_once(MAGPIE_DIR.'rss_fetch.inc');

$url = $_GET['url'];
if ( $url ) {
	$rss = fetch_rss( $url );
if($rss)
{		
	echo "<HTML>";
	echo "<link rel='Shortcut Icon' href='/images/qrotatoricon.gif'>";
	echo "<link rel='stylesheet' type='text/css' href='/summary.css' />";
	echo "<body leftmargin='15'><table width='90%' cellspacing='0' cellpadding='0' border='0' align='left'><tr><td width='100%'>";
	echo '<div class="channelname"><a href=';
	echo '"';
	echo $rss->channel['link'];
	echo '">' . $rss->channel['title'] . '</a></div>';
	echo "<ul>";
	foreach ($rss->items as $item) {
		$href = $item['link'];
		$title = $item['title'];	
		echo "[*]<a href=$href>$title</a>
".$item['description']."

";
	}
	echo "[/list]";
}
else
{
	echo "<HTML>";
	echo "<link rel='stylesheet' type='text/css' href='/summary.css' />";
	echo "<body leftmargin='15'><table width='90%' cellspacing='0' cellpadding='0' border='0' align='left'><tr><td width='100%'>";
echo '

RSS Feed Currently Unavailable. Try refreshing your browser (at least twice). Contact QSupport if this problem continues</p>';
}
}
}
?>

</td></tr></table></body></html>
The you reference it with http://yourdomain/yourphpfile.php?ur...ourrssfeed.xml
__________________
Jim Gray
http://quikonnex.com
Publishing without Email!
Reply With Quote
  #12 (permalink)  
Old 09-27-2004, 12:43 PM
mlevenhagen's Avatar
WebProWorld Veteran
 

Join Date: Sep 2004
Location: Wisconsin, United States
Posts: 439
mlevenhagen RepRank 0
Default RSS to Javascript

I've worked with RSS feeds on my site a bit....

Visit RSS to JavaScript

I'm not a programmer so I may be completely irrelavant here, but if you don't want to worry about PHP this works well & it's FREE. You can slot it right into your HTML.

A PHP version would be better...
__________________
Matt Levenhagen
Campaign Blasts - Affiliate Marketing & Adwords Training
Blaster's eZine - An Adwords & Affiliate Marketing Publication
Reply With Quote
  #13 (permalink)  
Old 09-30-2004, 09:54 AM
WebProWorld New Member
 

Join Date: Sep 2004
Posts: 7
notepage RepRank 0
Default Displaying RSS

Hi,
The following sites and tools will help webmasters generate java or html that can be used to display content in rss feeds:

http://www.rss-specifications.com/display-rss.htm

HTH
__________________
Sharon Housley
NotePage, Inc. - http://www.notepage.net
FeedForAll - http://www.feedforall.com
Reply With Quote
  #14 (permalink)  
Old 09-30-2004, 10:10 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Nice find!

Excellent resource Sharon!

I've added it to the recommended RSS links in "Programming Resources"

Paul
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0