I issued a query request to sql server with "FOR XML AUTO, type, elements, root('root')" appended to the end of my query. I issue a da.Fill(ds) [to a datset] which works without any problems. Now that I have the data, I want to transform it into HTML.
So I used:
Dim XMLString As String = ds.GetXml()
that converts my data into a string. Here's the satrt of my PROBLEM!!
Then I go:
strHTMLDetails = GetHtml(Server.MapPath("~/TEO.xslt"), XMLString)
which passes the xsl (within my project) and the xmlstring to a sub.
Then my code is as follows:
Dim stream As New MemoryStream(ASCIIEncoding.Default.GetBytes(XMLString)
Dim document As New XPathDocument(stream)
Dim writer As New StringWriter()
transform.Load(xsltPath)
transform.Transform(document, Nothing, writer) <====== Here's my error:
White space cannot be stripped from input documents that have already been loaded. Provide the input document as an XmlReader instead.
I don't understand what's wrong or how to resolve it. Please help?
Thank you, hlpearl