RE: [xsl] Rendering XML Server Side without using ASP

Subject: RE: [xsl] Rendering XML Server Side without using ASP
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Jan 2002 13:54:13 -0000
Chris,

Granted, and fair play for demonstrating your point as complete as this.

I suspect that in this case the data would originally be held in a database,
then converted to xml and sent to the client.  So the processing is really
performed serverside anyway.

If the data is already held in xml, it would seem a waste to search the xml,
produce more xml, then send that and the stylesheet to the client.

Of course, if you want to offload processing from the server to the client
then it is an option, but how much processing difference is there between
producing xml output and sending two files and producing html output and
sending one (bigger) file?

cheers

andrew

===

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Chris Bayes
Sent: Wednesday, January 30, 2002 1:03 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Rendering XML Server Side without using ASP


> >> 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



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread