Questions tagged [writeelementstring]

4 questions
9
votes
5 answers

C#: XmlTextWriter.WriteElementString fails on empty strings?

I'm using XmlTextWriter and its WriteElementString method, for example: XmlTextWriter writer = new XmlTextWriter("filename.xml", null); writer.WriteStartElement("User"); writer.WriteElementString("Username",…
Roee Adler
  • 33,434
  • 32
  • 105
  • 133
1
vote
3 answers

writing an empty xml element in c# using xmlwriter

I'm using xmlwriter in order to edit xml files, but I need it to maintain a specific format for future comparisons with other xml files. I'm using the following code to write empty…
eitanx
  • 13
  • 1
  • 3
1
vote
2 answers

XmlTextWriter: Allows Unicode?

I'm using XmlTextWriter to save certain configuration elements for my program (it's only 10-15 string values, this is why I'm using XmlTextWriter). My code looks as follows: XmlTextWriter writer = new XmlTextWriter("FILENAME.XML",…
Bab Yogoo
  • 6,669
  • 6
  • 22
  • 17
0
votes
1 answer

Blank or extra starting element vb.net html write

I need to write an xml file with two starting elements how can I do this? I have tried the following but to no avail. Dim xmldoc As XmlDocument = New XmlDocument() xmldoc.Load(IO.Directory.GetCurrentDirectory & "\Projects.xml") …
LabRat
  • 1,996
  • 11
  • 56
  • 91