working with large xml feeds..how to speed things up?

admin

Administrator
Staff member
Hi all

Am new to xml programming and have looked everywhere for an answer but have not found...

I am working with a large xml feed (approx 7Mb xml file) which contains product data for many electrical products. I have made an xsl file and an html file containing a javascript that loads the xml and xls into the browser. The problem is that it takes a full minute to load on a remote web server (of course it's o.k when run locally)...

Is there any way to speed things up at all (other than importimng the xml into a database-driven website)?

eventually it would be nice to have seperate pages for the different product categories (i.e an html and xsl file for each category - all would share the same xml feed of course).

Any light shed would be much appreciated as I am tearing my hear out atm (not much left either ;) I have included the code below.

TIA - Tiempo

Here is the html code:

<html>
<body>

</div></body>
</html>

<div align="CENTER"><script type="text/javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("cometfeed.xml")
// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("washers.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>


and here is the xsl i haev written:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>

<h1>Integrated Washer Dryers</h1>

<table border="0" bgcolor='#FFCC99' cellpadding="0" cellspacing="0" width="90%">
<tr bgcolor="#9acd32">
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-size:10pt;color:#9acd32">Model</th>
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt;">Model</th>
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt;">Description</th>
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt;">Price</th>
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-size:10pt;color:#9acd32">Photo</th>
<th align="left" style="font-family:Arial,helvetica,sans-serif;font-size:10pt;color:#9acd32">Model</th>
</tr>
<xsl:for-each select="product_catalog_data/product[category='Integrated Washer Dryers']">
<tr bgcolor='#FFCC99'>
<td></td>
<td valign="BOTTOM" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt;"><xsl:value-of select="name"/><hr></hr></td>
<td valign="BOTTOM" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt; color:#FF0000"><xsl:value-of select="description"/><hr></hr></td>
<td valign="BOTTOM" style="font-family:Arial,helvetica,sans-serif;font-weight:bold;font-size:10pt;"><div align="LEFT">?lt;xsl:value-of select="price"/><br /><br /><a href=http://www.webdeveloper.com/forum/archive/index.php/"{buyurl}" target="_blank">Buy Now!</a></div><hr></hr></td>
<td valign="BOTTOM"> <div align="RIGHT"><img src="{imageurl}" width="80" height="80"/></div><hr></hr></td>

</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>
 
Back
Top