Export XML w/XSL

  • Thread starter Thread starter rbutch
  • Start date Start date
R

rbutch

guys, im exporting the data from a grid to XML and trying to also add xsl with it.
is there some way i can do this that will include the headers from the grid?
i'm also getting an error



Imports System.Xml.Xsl
Imports System.Xml
then in a sub procedure::

Dim strFilename As String
strFilename = "C:\Customers.xml"
Dim fs As New System.IO.FileStream(strFilename, _
System.IO.FileMode.Create)
Dim xtw As New System.Xml.XmlTextWriter(fs, _
System.Text.Encoding.Unicode)
xtw.WriteProcessingInstruction("xml", "version='1.0'")

this exports the instance doc.
here's what im using to export the xsl::


xtw.WriteProcessingInstruction("xsl:stylesheet", "xmlns:xsl='http://www.w3.org/TR/WD-xsl'")

xtw.WriteProcessingInstruction("stylesheet version=1.0", "xmlns = 'http://www.w3.org/1999/XSL/Transform'")

here's the error:
there is an invalid name character in stylesheet=1.0

if anyone has any ideas or somewhere i can go and get the proper export code, i would appreciate it.
i tried exporting from VB.NET to Excel but, have had no luck at all

thanks again
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Hi,

If your grid point to the DataSet, then you could save DataSet in XML format
with or without corresponding schema (XSD). To do it just use WriteXml
method of the DataSet. Is it what you need?
 
Back
Top