Someone is eating my <?xml version="1.0"?> returning an Excel XML in Asp.net MVC -


I'm playing with VB XML Litles for Return and Excel XML files. ?. The problem is that & lt; XML version = "1.0" & gt; is not for download

Here is the code:

  Public Class ReservasController Function Test () Response.Clear () Response.AddHeader ("Content- Configuration "," attachment; file name = test.xml ") Response.ContentType =" application / vnd.ms-excel "Response.ContentEncoding = System.Text.Encoding.GetEncoding (" utf-8 ") Response.Write (GetXML ()) '' // It works: '' //Response.Write("<?xml version = "" 1.0 "" & gt; "+ GetXML () ToString ()) Response.End () Return Anything end function  

GetXML method is very simple:?

  Return PrivateXGetXML () function & lt ;? XML version = "1.0"? & Gt; & Lt ;? Mso-application progid = "Excel.Sheet"? & Gt; & Lt; Workbook xmlns = "vase: schema-microsoft com: office: spreadsheet" xmlns: o = "vase: schema-microsoft com: office: office" xmlns: x = "vase: schema-microsoft com: office: excel" xmlns: ss = "Vase: schema-microsoft-com: office: spreadsheet" xmlns: html = "http://www.w3.org/TR/REC-html40" & gt; & Lt; DocumentProperties xmlns = "karash: schema-microsoft-com: office: office" & gt; & Lt; Author & gt; Bizaco Excel Generator & lt; / Author & gt; & Lt; Last authorized & gt; BizkAx Accelerator Generator & lt; / Last Writer & gt; & Lt; Created & gt; 20100101 & lt; / Built-in & gt; & Lt; Company & gt; Bizcacha & lt; / Company & gt; & Lt; Version & gt; 1 & lt; / Edition & gt; & Lt; / DocumentProperties & gt; & Lt; ExcelWorkbook xmlns = "karash: schema-microsoft-com: office: excel" & gt; & Lt; / ExcelWorkbook & gt; & Lt; Styles & gt; & Lt; Style SS: id = "default" SS: name = "normal" & gt; & Lt; Alignment SS: Vertical = "Down" /> & Lt; Border / & gt; & Lt; Font / & gt; & Lt; Internal / & gt; & Lt; NumberFormat / & gt; & Lt; Protection / & gt; & Lt; / Style & gt; & Lt; / Styles & gt; & Lt; Worksheet SS: Name = "Title" & gt; & Lt; Table x: full column = "1" x: full-line = "1" ss: DefaultRowHeight = "15" & gt; & Lt; Column SS: width = "100" /> & Lt; Column SS: width = "100" /> & Lt; Line ss: autofit = "0" & ​​gt; & Lt; Cells SS: StyleID = "Default" & gt; & Lt; Data ss: type = "string" & gt; Hello & lt; / Data & gt; & Lt; / Cell & gt; & Lt; Cells ss: StyleID = "default" & gt; & Lt; Data ss: type = "string" & gt; World & lt; / Data & gt; & Lt; / Cell & gt; & Lt; / Row & gt; & Lt; / Table & gt; & Lt; / Worksheet & gt; & Lt; / Workbook & gt; Last Function Angle Class  

Looking at it, will it be anything to back it The string in which quotes are used ... Why not replace those quotes with Chr (34) which is the ASCII code for " ... as an example:

 Const char DblQuote as String = Chr (34) Private Function GetXML () return " 

Hope it helps, best wishes, Tom.

/ Div>

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -