This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Rendering XML Server Side without using ASP
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 30 Jan 2002 13:02:44 -0000
- Subject: RE: [xsl] Rendering XML Server Side without using ASP
- Reply-to: xsl-list at lists dot mulberrytech dot com
> >> My
> >> site used to do
> >> this, but I found it too slow to send the XML and various
> >> stylesheets to the
> >> client each time, so I went for complete serverside.
> >
> >You must have had some strange xml and stylesheets. It is
> not always the
> >case but more often than not that if your xml and xsl is designed
> >properly there will be less data on the wire if you send xml
> and xsl to
> >the client for transformation rather than sending the
> transformed html.
> >
> >Ciao Chris
>
> I cant see how. In my a case a list of businesses, searched
> by name 'Joe
> Bloggs', will produce some HTML much smaller than the
> original xml. I wont
> claim to have designed it properly, but this seems obvious.
> Maybe I dont
> understand what you're saying..?
>
Well if you ship a whole database as xml to the client to only format
say 10 records then you are right but if you only sent the 10 records
and the stylesheet i.e.
<?xml version="1.0" ?>
<r>
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
<b n="fred bloggs inc" a1="bloggs building" a2="bloggs road"
a3="bloggville" t="1234567890" />
</r>
+
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "html" encoding="Windows-1252" />
<xsl:template match="/r">
<html>
<head></head>
<body>
<table>
<xsl:apply-templates />
</table>
</body>
</html>
</xsl:template>
<xsl:template match="b">
<tr><xsl:apply-templates select="@*" /></tr>
</xsl:template>
<xsl:template match="@*">
<td class="someclass" nowrap="nowrap"><xsl:value-of
select="." /></td>
</xsl:template>
</xsl:stylesheet>
=1491 chars
<html>
<head>
<META http-equiv="Content-Type" content="text/html;
charset=Windows-1252">
</head>
<body>
<table>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
<tr><td class="someclass" nowrap>fred bloggs inc</td>
<td class="someclass" nowrap>bloggs building</td>
<td class="someclass" nowrap>bloggs road</td>
<td class="someclass" nowrap>bloggville</td>
<td class="someclass" nowrap>1234567890</td>
</tr>
</table>
</body>
</html>
=2528 chars
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list