tags:

views:

12

answers:

0

I've been searching for a day now - so any help at all would be so greatly appreciated!

I have a URL for a feed in xml format - it doesn't have an xml extension, so after some searching I found this code example to extract the information from the feed and create my own locally saved xml file:

<?xml version="1.0" ?>
<?xml-stylesheet href="feeder.xsl" type="text/xsl"?>
<feeds>
<feed src="http://www.xyz.com/mmblog.xml"/&gt;
<feed src="http://www.wired.com/news/feeds/rss2/0,2610,,00.xml"/&gt;
<feed src="http://rss.cnn.com/rss/cnn_topstories.rss"/&gt;
</feeds>

It then instructed me to style the feed and set the format in an xslt file (saved as feeder.xsl), also saved in my root as follows:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
<xsl:template match="feeds">
<html><head><title>Today's News</title></head>
<style>
<xsl:comment>
h1 {
width=600px;
font-family:verdana, arial;
font-size:12pt;
font-weight:bold;
color:#FFFFFF;
background-color:#660000;
}

p {
width=600px;
font-family:verdana, arial;
font-size:9pt;
color:#333333;
}

.date {
color:#999999;
}

a:link {
font-weight:bold;
text-decoration:none;
color:#660000;
}

a:hover {
font-weight:bold;
text-decoration:none;
color:#990000;
}

a:visited {
font-weight:bold;
text-decoration:none;
color:#333333;
}
</xsl:comment>
</style>

<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="feed">
<xsl:apply-templates select="document(@src)"/>
</xsl:template>

<xsl:template match="channel">
<h1><xsl:value-of select="title"/></h1>
<xsl:apply-templates select="item"/>
</xsl:template>

<xsl:template match="item">
<p>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:apply-templates select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
<br />
<xsl:value-of select="description"/>
<br />
<span>
<xsl:if test="pubDate">
<xsl:value-of select="pubDate"/>
</xsl:if>
</span>
</p>
</xsl:template>
</xsl:stylesheet>

[B]My question is[/B] - how can I parse / display and embed the xml file information (extracted from the feed urls whilst referencing the xslt file format) into a separate html page containing other information? Wouldn't my html page's head and body tags conflict with those pulled in from the feeder.xslt file?

I also found some ASP script to pull both sources in:

<%
'Load XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("feed.xml"))

'Load XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("feeder.xsl"))

'Transform file
Response.Write(xml.transformNode(xsl))
%>

But I just can't seem to figure out how to get it to work!! I'm great with directions- so any help would save me any more hassle as I've spent almost 2 days searching!!

Please help