Hello, I am trying to learn xml/xsl and am stuck with a very basic problem :
my xml page is like this :
<?xml version ='1.0' encoding='UTF-8'?>
<root xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
<sql:query>
SELECT CompanyName, ContactName, Phone FROM suppliers FOR XML AUTO
</sql:query>
</root>
my xsl is like this :
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match = '*'>
<xsl:apply-templates />
</xsl:template>
<xsl:template match = 'Suppliers'>
<TR>
<TD><xsl:value-of select = '@CompanyName' /></TD>
<TD><xsl:value-of select = '@ContactName' /></TD>
<TD><xsl:value-of select = '@Phone' /></TD>
</TR>
</xsl:template>
<xsl:template match = '/'>
<HTML>
<HEAD>
<STYLE>th { background-color: #CCCCCC }</STYLE>
</HEAD>
<BODY>
<TABLE border='1' style='width:300;'>
<TR><TH colspan='3'>suppliers</TH></TR>
<TR><TH >Company Name</TH><TH>Contact Name</TH><TH>Extension</TH></TR>
<xsl:apply-templates select = 'root' />
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I am typing this in the URL :
I can see the table headings, but not data underneath, what am I missing ?
(this is a modified example form a microsoft page)
thanks for the help..
my xml page is like this :
<?xml version ='1.0' encoding='UTF-8'?>
<root xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
<sql:query>
SELECT CompanyName, ContactName, Phone FROM suppliers FOR XML AUTO
</sql:query>
</root>
my xsl is like this :
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match = '*'>
<xsl:apply-templates />
</xsl:template>
<xsl:template match = 'Suppliers'>
<TR>
<TD><xsl:value-of select = '@CompanyName' /></TD>
<TD><xsl:value-of select = '@ContactName' /></TD>
<TD><xsl:value-of select = '@Phone' /></TD>
</TR>
</xsl:template>
<xsl:template match = '/'>
<HTML>
<HEAD>
<STYLE>th { background-color: #CCCCCC }</STYLE>
</HEAD>
<BODY>
<TABLE border='1' style='width:300;'>
<TR><TH colspan='3'>suppliers</TH></TR>
<TR><TH >Company Name</TH><TH>Contact Name</TH><TH>Extension</TH></TR>
<xsl:apply-templates select = 'root' />
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I am typing this in the URL :
I can see the table headings, but not data underneath, what am I missing ?
(this is a modified example form a microsoft page)
thanks for the help..