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
1
vote
1 answer

.Net XmlTextWriter: prevent replacing of > or < with > or <

I'm creating xml-like mark-up language using System.Xml.XmTextWriter that will be read by a third party app. In this mark-up language, symbols > and < when inside an element, need to show up as, but the XmlTextWriter converts them to > ; and < ;…
andyhasit
  • 14,137
  • 7
  • 49
  • 51
1
vote
1 answer

Omitting elements using custom XmlTextWriter

I'm implementing a custom XmlTextWriter and I'd like to omit any elements with a particular name that contain no attributes. I've gotten as far as being able to prevent the element from being written by overriding WriteStartElement and…
HotN
  • 4,216
  • 3
  • 40
  • 51
1
vote
1 answer

Looping checkboxlist and create XML using XMLTextWriter VB.net

I am a beginner developer with xml and .net. I have series of checkboxlists and I want to produce an xml file depending on the user select. I want xml file to be like this.
Laurence
  • 7,633
  • 21
  • 78
  • 129
1
vote
3 answers

xmltextwriter transforms special characters

I get special characters transformed in the result of an xslt file transformation. Has anyone experienced this before? In the source document there's a character & which in the result is presented as &. I need the the original & character even…
Florjon
  • 3,569
  • 3
  • 22
  • 29
1
vote
3 answers

WriteStartDocument() throws InvalidOperationException

I'm trying to generate XML and I encounter this exception: XmlTextWriter xmlWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8); xmlWriter.WriteStartDocument(); xmlWriter.WriteStartElement("userInfo"); It gives me an exception:…
LB.
  • 13,730
  • 24
  • 67
  • 102
1
vote
1 answer

problems with converting string which contains xml code into XmlTextWriter

I have a string variable Writer that recieves xml code from another window. I need to pass this string to textWriter variable but i dont know how to make it readable by textWriter. I tried to convert it to XmlTextWriter but it dont seem to work. How…
Kegel
  • 11
  • 4
1
vote
1 answer

Why is a namespace prefix being added to my XML attribute?

I have a fiddle here: using System; using System.Xml; using System.IO; using System.Text; public class Program { public static void Main() { Console.WriteLine("Starting"); MemoryStream stream = new…
David Thielen
  • 28,723
  • 34
  • 119
  • 193
1
vote
2 answers

Powershell: How to create an empty Excel worksheet-XML via XmlTextWriter?

I am currently writing a Powershell code to import a very large DataTable into an Excel-File without having Excel installed on that machine. All is fine till now, except that I dont know how to create the worksheet.xml structure via an…
Carsten
  • 1,612
  • 14
  • 21
1
vote
0 answers

Generation of xml files via recursion (of self joined table) not yielding desired hierarchy

I have the task of generating XML files from data populated in a self-joined table; all the XML files must conform to the hierarchy as defined in the self join. I have written some recursive code to achieve this with some success but my logic never…
1
vote
0 answers

How to read and create child nodes using XmlReader

I have a xml file. I trying generate a new xml file from that old xml file with some modification. I have xml like this
1
vote
2 answers

Overwriting with a XmlTextWriter?

Simple question, how do i overwrite with a xmltextwriter? I use var writer = new XmlTextWriter(exam.Path, null);. SO if i have a new document it writes as i should be. But if the document already exists, how do i overwrite this document by a new…
Ruben
  • 1,033
  • 3
  • 12
  • 22
1
vote
1 answer

C libxml2 xmlTextWriter tags nest themselves randomly

I have a struct that I am trying to save as an xml, it seems to have no problems with creating small XMLs, however in the case of larger files it seems to nest the later tags, for the first 30 or so I am getting correct results in the…
0x777C
  • 993
  • 7
  • 21
1
vote
1 answer

Most efficient way to replace text in xml stream

I have a huge chunk of XML data that I need to "clean". The Xml looks something like this:
Jesper Lund Stocholm
  • 1,973
  • 2
  • 27
  • 49
1
vote
1 answer

XMLWriter formatting when appending to existing XML

I've got an existing XML file. New content is added to it via XmlWriter (or XmlTextWriter, doesn't matter which as both exhibit the same behaviour). The problem: The new content is not formatted with indentation. Sample output by XmlWriter with…
cacau
  • 3,606
  • 3
  • 21
  • 42
1
vote
1 answer

Replace OuterXml OR generate intended string from InnerXml

I have a UI that uses the DataGridView to display the content of XML files. If XmlNode contains only InnerText, it's quite simple, however I'm having a problem with nodes that contains childnodes (and not only string).…
Martin Zugec
  • 165
  • 1
  • 7