	Even if you don't know XSL, you can probably figure out what's going on from context: The "name" attribute of every s:AttributeType element streams out as table column headers, and every z:row element parameter value streams out as cell contents, assigning each z:row element its own row in the table. To understand how this works, let's start with a code block. It tells IE5 to process XML elements within the whole document (match="/" signifies that the "root" element of the document should be processed, not just a particular section) and to produce table tags (<TABLE> and </TABLE>) and other HTML niceties before and afterward:

<xsl:template match="/"> 
<HTML><HEAD><TITLE>XSL-Formatted ADO 
Recordset</TITLE></HEAD>
	<BODY><FONT FACE="Tahoma" size="2">
		<TABLE border="1" COLOR="BLUE">
		...
	</TABLE>
	</FONT></BODY></HTML>
</xsl:template> 

	Next, this code outputs the value of the "name" parameter for each s:AttributeType element surrounded by table cell tags (<TD> and </TD>) and other HTML formatting code:

<TR> 
	<xsl:for-each
	select="*/s:Schema/s:ElementType
	/s:AttributeType"> 
		<TD><STRONG><FONT COLOR="RED" 
		size="2"> 
			<xsl:value-of
			select="@name" /> 
		</FONT></STRONG></TD> 
	</xsl:for-each> 
</TR> 

Note that the "@" specifies you're interested in a parameter and not a subelement. The entire set of attribute names is contained within table row tags (<TR> and </TR>).
	Next, this construct instructs the XML engine to loop though the contents of each s:AttributeType element and put table row tags before and afterwards:

<TR> 
	<xsl:for-each
	select="*/s:Schema/s:ElementType/
	s:AttributeType"> 
			...
	</xsl:for-each> 
</TR>

The ellipsis in the code snippet represents the following block of code, which instructs the XML engine to output the value of each parameter (the "*" is a wild card) within table cell tags and some HTML code to present the data in blue:

<xsl:for-each select="@*"> 
	<TD><FONT COLOR="BLUE" size="2">
		<xsl:value-of/>
	</FONT></TD> 
</xsl:for-each> 

	That's all there is to building the XSL file. 



XSL | Display It as an HTML Table.

Listing 1 This XSL code enables any ADO-produced XML file to display as an HTML table. By referencing each z:row element attribute generically with the "@*" wildcard, XSL avoids referring to specific field names and can be reused with a variety of ASP pages.

<?xml version="1.0"?>
<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML><HEAD><TITLE>XSL-Formatted ADO 
Recordset</TITLE></HEAD>
	<BODY><FONT FACE="Tahoma" size="2">
		<TABLE border="1" COLOR="BLUE">
			<TR>
				<xsl:for-each 
select="*/s:Schema/s:ElementType/s:AttributeType">
					<TD><STRONG><FONT COLOR="RED" 
size="2"><xsl:value-of 
select="@name"/></FONT></STRONG></TD>
					</xsl:for-each>
			</TR>
			<xsl:for-each select="*/rs:data/z:row">
		        <TR>
					<xsl:for-each select="@*">
						<TD><FONT COLOR="BLUE" 
size="2"><xsl:value-of/></FONT></TD>
					</xsl:for-each>
				</TR>
			</xsl:for-each>
		</TABLE>
	</FONT></BODY></HTML>
	</xsl:template>
</xsl:stylesheet>

