I am trying to receive multiple feeds from other sites and sort them into an order.. I can do this with one site but am struggling to with more..
Any help/insight is greatly appreciated_PHP Code:// Load the XML source
$xml = new DOMDocument;
$xml->load('http://www.feedsite.asp?section=Weather&Type=B');
$xsl = new DOMDocument;
$xsl->loadXML('<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Event</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Month</th>
<th>Back</th>
</tr>
<xsl:for-each select="temperature/event/subevent/selection">
<xsl:sort select="@backp1" data-type="number"/>
<tr>
<td><xsl:value-of select="@month"/></td>
<td><xsl:value-of select="@backp1"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$sorted = $proc->transformToDoc($xml);
$sorted->formatOutput = true;
$sorted->preserveWhiteSpac



Reply With Quote
Bookmarks