Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
Questionoffline wikipidia Pin
Member 1075034520-May-14 6:42
Member 1075034520-May-14 6:42 
AnswerRe: offline wikipidia Pin
Pete O'Hanlon20-May-14 6:45
mvePete O'Hanlon20-May-14 6:45 
QuestionHow can I add standalone="no" in creating an XML file? Pin
Member 1063699820-May-14 4:13
Member 1063699820-May-14 4:13 
AnswerRe: How can I add standalone="no" in creating an XML file? Pin
thatraja20-May-14 5:30
professionalthatraja20-May-14 5:30 
GeneralRe: How can I add standalone="no" in creating an XML file? Pin
Member 1063699820-May-14 6:03
Member 1063699820-May-14 6:03 
GeneralRe: How can I add standalone="no" in creating an XML file? Pin
thatraja20-May-14 23:10
professionalthatraja20-May-14 23:10 
GeneralRe: How can I add standalone="no" in creating an XML file? Pin
Member 1063699821-May-14 4:37
Member 1063699821-May-14 4:37 
AnswerRe: How can I add standalone="no" in creating an XML file? Pin
Francine DeGrood Taylor20-May-14 13:16
Francine DeGrood Taylor20-May-14 13:16 
I had the same problem. I had to go with XmlDocument:


XmlNode docNode = doc.CreateXmlDeclaration("1.0", "iso-8859-1", "no");

I'm guessing you are viewing this in a browser instead of a text file. One thing that you may notice is that the "ISO" becomes capitalized in a browser, but if you look at it with a text editor like Notepad, it looks the way you want it. Also, the browser translates "no" to "false". If you want to see what it looks like exactly, use Notepad.

You might also try this:

XmlSerializer xmlSer = new XmlSerializer(typeof(T));
using (MemoryStream mem = new MemoryStream())
{
using (XmlWriter writer = XmlWriter.Create(mem))
{
string doubleQuote = ((char)34).ToString();
string s = "version=" + doubleQuote + "1.0" + doubleQuote + " encoding=" + doubleQuote + "iso-8859-1" + doubleQuote + " standalone=" + doubleQuote + "no" + doubleQuote;
writer.WriteProcessingInstruction("xml", s);
xmlSer.Serialize(writer, objectToSerialize);
}
}

modified 20-May-14 19:51pm.

GeneralRe: How can I add standalone="no" in creating an XML file? Pin
Member 1063699821-May-14 4:33
Member 1063699821-May-14 4:33 
Questionwhich is the best way Pin
Srikanth95420-May-14 2:03
Srikanth95420-May-14 2:03 
AnswerRe: which is the best way Pin
OriginalGriff20-May-14 2:32
mveOriginalGriff20-May-14 2:32 
NewsAnyone Aware of this URI from MSDN Pin
cpquest20-May-14 1:03
cpquest20-May-14 1:03 
GeneralRe: Anyone Aware of this URI from MSDN Pin
Pete O'Hanlon20-May-14 1:09
mvePete O'Hanlon20-May-14 1:09 
Questionhow to create components like telerik and dev and .... Pin
Member 1059256819-May-14 21:39
Member 1059256819-May-14 21:39 
AnswerRe: how to create components like telerik and dev and .... Pin
Richard MacCutchan19-May-14 21:41
mveRichard MacCutchan19-May-14 21:41 
GeneralRe: how to create components like telerik and dev and .... Pin
Member 1059256819-May-14 21:42
Member 1059256819-May-14 21:42 
GeneralRe: how to create components like telerik and dev and .... Pin
OriginalGriff19-May-14 22:00
mveOriginalGriff19-May-14 22:00 
GeneralRe: how to create components like telerik and dev and .... Pin
Kornfeld Eliyahu Peter19-May-14 22:05
professionalKornfeld Eliyahu Peter19-May-14 22:05 
GeneralRe: how to create components like telerik and dev and .... Pin
OriginalGriff19-May-14 22:30
mveOriginalGriff19-May-14 22:30 
GeneralRe: how to create components like telerik and dev and .... Pin
Member 1059256819-May-14 22:19
Member 1059256819-May-14 22:19 
GeneralRe: how to create components like telerik and dev and .... Pin
OriginalGriff19-May-14 22:29
mveOriginalGriff19-May-14 22:29 
GeneralRe: how to create components like telerik and dev and .... Pin
Member 1059256819-May-14 22:35
Member 1059256819-May-14 22:35 
GeneralRe: how to create components like telerik and dev and .... Pin
Member 1059256819-May-14 22:37
Member 1059256819-May-14 22:37 
GeneralRe: how to create components like telerik and dev and .... Pin
Sanjay K. Gupta20-May-14 1:35
professionalSanjay K. Gupta20-May-14 1:35 
QuestionChange number in y-axis for line graph Pin
Syafiqah Zahirah19-May-14 8:01
Syafiqah Zahirah19-May-14 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.