views:

218

answers:

1

I am trying to run a DataTable through an XSL tranform and then put the results back into a DataTable. My DataTable is coming up empty. Any help would be great.

Dim finalExelList As New DataTable
Dim xlsMyList = New XPath.XPathDocument(New StringReader(myList.DataSet.GetXml()))
Dim trans As Xsl.XslCompiledTransform = New Xsl.XslCompiledTransform

trans.Load(RequestHandlerBase.ServerLocation & "xsl\dataisland2DotNet.xsl")
Using ms As MemoryStream = New MemoryStream
  trans.Transform(xlsMyList, Nothing, ms)
  ms.Position = 0
  finalExelList.ReadXml(ms)
End Using
+1  A: 

Your VB code looks reasonable, which means that most likely the XSL is incorrect, you need to debug it first. If you have XMLSpy -- use it (it has pretty decent XSL debugger). If you don't have an XSL debugger handy -- I'd suggest creating a really simple XSL transform, one that does return something for sure, and then gradually adding features step by step until it does what you need.