Bueno, la cuestión es que tampoco se mucho de este tema del xslt, no se si me podrían ayudar con mi problemilla y darme un poco mas de referencias para irme metiendo a este tema...
Si de algo sirve, les pongo el código del xslt:
Código:
Gracias de antemano private void CreateStylesheet(XmlTextWriter writer, string[] sHeaders, string[] sFileds, ExportFormat FormatType) { try { // xsl:stylesheet string ns = "http://www.w3.org/1999/XSL/Transform"; writer.Formatting = Formatting.Indented; writer.WriteStartDocument( ); writer.WriteStartElement("xsl","stylesheet",ns); writer.WriteAttributeString("version","1.0"); writer.WriteStartElement("xsl:output"); writer.WriteAttributeString("method","text"); writer.WriteAttributeString("version","4.0"); writer.WriteAttributeString("encoding","ISO-8859-1"); writer.WriteEndElement( ); // xsl-template writer.WriteStartElement("xsl:template"); writer.WriteAttributeString("match","/"); // xsl:value-of for headers for(int i=0; i< sHeaders.Length; i++) { writer.WriteString("\""); writer.WriteStartElement("xsl:value-of"); writer.WriteAttributeString("select", "'" + sHeaders[i] + "'"); writer.WriteEndElement( ); // xsl:value-of writer.WriteString("\""); if (i != sFileds.Length - 1) writer.WriteString( (FormatType == ExportFormat.CSV ) ? "," : " " ); } // xsl:for-each writer.WriteStartElement("xsl:for-each"); writer.WriteAttributeString("select","Export/Values"); writer.WriteString("\r\n"); // xsl:value-of for data fields for(int i=0; i< sFileds.Length; i++) { writer.WriteString("\""); writer.WriteStartElement("xsl:value-of"); writer.WriteAttributeString("select", sFileds[i]); writer.WriteEndElement( ); // xsl:value-of writer.WriteString("\""); if (i != sFileds.Length - 1) writer.WriteString( (FormatType == ExportFormat.CSV ) ? "," : " " ); } writer.WriteEndElement( ); // xsl:for-each writer.WriteEndElement( ); // xsl-template writer.WriteEndElement( ); // xsl:stylesheet writer.WriteEndDocument( ); } catch(Exception Ex) { throw Ex; } }