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
0
votes
0 answers

XmlTextWriter has newline character always

I'm serializing an object using the XmlTextWriter and I'm doing a ToString on the created XML structure. I have the following as my settings: settings.Indent = true; settings.NewLineOnAttributes = true; When I open the produced XML in Textpad or…
joesan
  • 13,963
  • 27
  • 95
  • 232
0
votes
1 answer

Is XmlTextWriter the fastest way to write out an XML file?

At present I am using XmlTextWriter with WrieStartElement(), WriteAttributeString(), & WriteEndElement(). Is this the fastest way to create an XML file? Update: I'm looking at XML writers, not raw string writers. Between characters that need to be…
David Thielen
  • 28,723
  • 34
  • 119
  • 193
0
votes
0 answers

How to set the encoding to UTF-8 for XmlTextWriter

This question may have been asked before but my case is a bit different. Since i am using the Stringwriter Function for my XMLwriter StringWriter stringWriter = new StringWriter(); XmlTextWriter writer = new…
MarsOne
  • 2,155
  • 5
  • 29
  • 53
0
votes
2 answers

Using XmlTextWriter to write value with a new line (keep proper indent) in c#

what I want is like this: value I've tried: WriteValue()/WriteString() will not start a new line: "value" WriteWhitespace(Environment.NewLine) will not keep the indent:
0
votes
3 answers

How to wrtie a XML License Line(ended with a forward slash '/') in C#?

I want to write a XML file as below: Some piece of my code…
Nano HE
  • 9,109
  • 31
  • 97
  • 137
0
votes
1 answer

How to add attribute and also elementString via XmlTextWriter?

I am using XmlTextWriter to generate the xml file. Most parts are fine, but encounter the problem to generate bellow part, What I need is: http://www.example.com partly main code of mine: ... using System.Xml; string…
Niuya
  • 428
  • 1
  • 5
  • 14
0
votes
0 answers

XmlTextWriter Allows Illegal Unicode Characters

XmlTextWriter allows 0x15 and 0x1A. Does anyone know how to get around this? If I serialize a string of XML containing the mentioned illegal characters XmlTextWriter allows this with no exceptions. Does anyone have a work around for this?
Maess
  • 4,118
  • 20
  • 29
0
votes
2 answers

whats the best way to generate an XML file if all tags (including closing tags) and their values come from DB?

I have a situation where I have to generate some XML files based on data that comes from DB. The structure of the data that is stored in DB is the problem. Actually all the TAGs and their values are stored in a table which also include closing TAGs…
Aamir
  • 1,747
  • 5
  • 26
  • 50
0
votes
2 answers

How to turn ON/OFF an XmlWriter Indent property?

I would like to turn ON/OFF the Indent property of a XmlWriter when I need it, to be able to write with this formatting: My Song 1.mp32007
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
0
votes
2 answers

C# XmlTextWriter class and VisualStudio

I'm trying to use the XmlTextWriter class in C# but it only works if I give the complete path to the file (as in "C:\file.xml"). If I try to use relative path (as in "file.xml"), it creates the file (in the same folder that contais the cs file) but…
thiagobrandam
  • 93
  • 1
  • 9
0
votes
1 answer

encoding HTML issues inside xml tag xmltextwriter

I'm dynamically creating, populating and submitting an infopath form to a SharePoint form library, I'm using the XMLTextWriter to create the xml for the infopath, just like this…
user1783490
  • 273
  • 1
  • 8
  • 23
0
votes
3 answers

Create XML in memory and pass to another method to transform via XSLT

This is what I'm trying to do. I'm sure the solution is simple, I just haven't found it yet (and believe me I've been trying). I have an object that I want to use to create XML data. (I'm using an XmlTextWriter to create the elements.) I then want…
Anne Schuessler
  • 1,692
  • 13
  • 25
0
votes
2 answers

is it possibile to read an XML file by a relative URL with XMLTextReader in ASP.NET IIS7.5

Is it possible in ASP.NET (not MVC) in IIS7.5 on Windows Server 2008R2 to read an XML file from a subfolder beneath the web app using a relative URL? Something like: Dim rdr As XmlTextReader rdr = New XmlTextReader( "xml\foo.xml") //…
Tim
  • 8,669
  • 31
  • 105
  • 183
0
votes
2 answers

How to use XmlTextWriter Element?

I have the following XML: 6134 Summ 200 200 What i tried and didn't…
Georg
  • 117
  • 3
  • 18
0
votes
1 answer

xml white space issue using c#

I am creating xml file using below code problem is when there is extra spaces in sentence or content this code is converting it into single space how to handle this using System; using System.IO; using System.Xml; public class Sample { …
Yogesh
  • 150
  • 1
  • 4
  • 20