Questions tagged [xmltextwriter]

Represents a writer that provides a fast, non-cached, forward-only way of generating streams

Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations.

http://msdn.microsoft.com/en-us/library/system.xml.xmltextwriter%28v=vs.110%29.aspx

120 questions
3
votes
1 answer

Viewing XmlTextwriter Content within debugger

I am working on some pretty complex code that is writing to a memorystream using an XmlTextwriter. Is there a way in Visual Studio debug to see the content of the memorystream/XmlTextwriter as I am stepping through code.
Robert
  • 1,129
  • 2
  • 12
  • 23
3
votes
1 answer

A few questions about XmlTextWriter

I am new to editing XML and I have a few questions to problems I'm running into. First: how do I add new lines after each writer.WriteEndElement();. I found examples using writer.WriteWhitespace("\n"); but it doesn't seem to make any new…
Johnston
  • 2,873
  • 8
  • 29
  • 39
3
votes
3 answers

How to write '&' in xml?

I am using xmlTextWriter to create the xml. writer.WriteStartElement("book"); writer.WriteAttributeString("author", "j.k.rowling"); writer.WriteAttributeString("year", "1990"); writer.WriteString("&"); writer.WriteEndElement(); But now i need to…
Giri
  • 931
  • 11
  • 31
  • 51
3
votes
1 answer

C# WriteDocType generates an incorrect PList doctype

Consider the following C# code: XmlTextWriter writer = new XmlTextWriter(pathFichier, null); writer.WriteStartDocument(); writer.WriteDocType("plist", "-//Apple//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd",…
bchhun
  • 18,116
  • 8
  • 28
  • 31
2
votes
2 answers

How to write quotation marks in KML through C# code

maybe a stupid question here but my html skills are faded now.. :) I am creating a KML file with a button click and all the code for the KML tags is there. What I need is using more than one tags. It will be hardcoded in the beginning of the KML.…
Pepys
  • 981
  • 7
  • 16
  • 34
2
votes
2 answers

C# System.Xml.Serialization - use only and never

I have a strange problem with my customer - I am reading an XML document (actually an InfoPath document) with XmlSerializer, modifying it, then writing out an XML document using the XmlSerializer, and then add some processing instructions by using…
Petr Osipov
  • 621
  • 6
  • 16
2
votes
1 answer

set multiple namespaces with XmlTextWriter

I'm trying to create an infopath form XML file. I was initially following this example programmatically-create-infopath-form-console-app but I'm getting issues with multiple namespaces. Here's some namespaces in my infopath form XML…
Jummi
  • 123
  • 1
  • 13
2
votes
1 answer

"" c# linq or XDocument remove encoding=UTF-8

XDocument xdoc = new XDocument( new XDeclaration("1.0", null, null), new XElement(bla)); using (var writer = new XmlTextWriter(@"folderpath\index.xml", new UTF8Encoding(false))) { //writer.Formatting = Formatting.Indented; …
Sebastian
  • 66
  • 1
  • 6
2
votes
3 answers

System.Xml.XmlTextWriter.WriteStartDocument()

What does this method do, and why is it necessary? The "go to definition" option leads me to a function containing all comments, here's what it says about its purpose //Writes the XML declaration with the version "1.0" and the standalone…
superlazyname
  • 265
  • 3
  • 7
  • 17
2
votes
1 answer

XmlTextWriter.WriteFullEndElement tags on the same line

I am using an XMLTextWriter to create an XML document dynamically (in VB.Net). I want empty tags to appear like this - and not this - So, I am using WriteFullEndElement to end the element tag. But it is writing out the tag as -…
Apeksha
  • 485
  • 6
  • 23
2
votes
1 answer

Stream and XmlTextwriter.... Request is not received correctly

Im stuck on this httpWebRequest problem. I need to send XML to a website. But I keep getting negative responses on my request. I saw some code examples where the ContentLength was set... And that might be the issue but I don't know.... The XML…
Rickjaah
  • 581
  • 1
  • 6
  • 16
2
votes
1 answer

XMLTextWriter to XMLDocument

I've got an XMLTextWriter writing to a Stream of a WebRequest. Everything works as it should: Dim wr As WebRequest = WebRequest.Create("https://wwwcie.ups.com/ups.app/xml/ShipAccept") With wr .Method = "POST" .ContentType =…
Nick Spiers
  • 2,344
  • 2
  • 19
  • 31
2
votes
3 answers

How to Write XML in c#?

Georg
  • 117
  • 3
  • 18
2
votes
1 answer

How do I generate " in XML from C#

I'm using XmlTextWriter to generate XML from a C# app. The initial input will be in this format, 1" , but I can replace it with whatever. I need to end up with 1" but I keep getting 1" C# xml.WriteStartElement("data"); …
topofsteel
  • 1,267
  • 6
  • 16
  • 25
2
votes
2 answers

C#: Sanitize XML text values with XmlTextWriter?

I'm using XmlTextWriter to serialize and persist some of my data. Several of the fields I serialize are based on user input (e.g. Username). Today I use the WriteElementString method of XmlTextWriter. My question is: the second parameter of…
Roee Adler
  • 33,434
  • 32
  • 105
  • 133