Hi guys,
I am having problems using XSLT transformation language with
my database.
I have the following XSLT code, the VB code follows next. My
database has
a first field of sid, the idea here is to test by retrieving
all sids, but
I am getting a blank page result. Any ideas?
<?xml version="1.0"
encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns sl=&
quot;http://www.w3.or
g/1999/XSL/Transform">
<xsl:output indent ="yes"
method="html"/>
<xsl:template match="/">
<html>
<body>
<xsl:for-each
select="students/Table">
<tr>
<xsl:value-of select="sid" />
</tr>
</xsl:for-each>
</body>
</html>
</xsl:template>
************************************************************
*************
and the following VB Code:
Partial Class xmltest
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e
As System.EventArgs)
Handles Me.Load
Dim conn As New
SqlConnection(ConfigurationManager.ConnectionStrings("
exmateConnectionString1").ConnectionString)
Dim dataset As DataSet = New
DataSet("students")
Dim xmlSW As System.IO.StreamWriter = New
System.IO.StreamWriter("C:\tester.xml")
Dim adapter As SqlDataAdapter = New
SqlDataAdapter("SELECT * FROM
MS120FINAL AS XML", conn)
adapter.Fill(dataset)
dataset.WriteXml(xmlSW)
xmlSW.Close()
conn.Close()
Dim xmlDoc As XmlDataDocument = New
XmlDataDocument(dataset)
Dim xslTran As XslTransform = New XslTransform
xslTran.Load("C:\Inetpub\wwwroot\Exmate\App_Data\
tester.xsl")
Dim writer As XmlTextWriter = New
XmlTextWriter("xsltoutput.html",
System.Text.Encoding.UTF8)
xslTran.Transform(xmlDoc, Nothing, writer)
End Sub
End Class
Amofa Kodom Baffoe,
School of Computing,
Dublin City University,
Glasnevin, Dublin 9
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|