Questions tagged [xmltextreader]

126 questions
1
vote
1 answer

XmlTextReader for json?

Is there something that is similar to XmlTextReader in terms of performance, but using JSON instead? I have the choice between parsing data in XML or parsing the same data in JSON. I'd like to use JSON because I figure I could save a bit of…
Radu
  • 8,561
  • 8
  • 55
  • 91
1
vote
4 answers

XML Reader Performance

I've traced slugishness in my application to the bit of code that's being timed below. I knew that this would be a slow point but each request is taking an average of 1 second. The bit of xml that I'm after is always in the first tag so I don't…
Radu
  • 8,561
  • 8
  • 55
  • 91
1
vote
1 answer

XmlTextReader/XmlNodeType namespace could not be found, how to fix?

My errors are in C# and idk why its telling me that XmlTextReader namespace could not be found. And I have to same error with XmlNodeType saying that it could not be found. How do I fix this? Here is my code: using System; using…
Remi
  • 29
  • 5
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

XmlTextReader not working properly

I am trying to make a loop that reads an XML document for an item with a specific id number, and then stores the child nodes of this item as variables, which are then used to populate labels on my page. Sub LinkButton_Click(sender As Object, e As…
MRG
  • 119
  • 1
  • 6
1
vote
2 answers

Can XmlTextReader tell the difference between and

I am reading an XML file using an XMLTextReader. Is there a way to tell the difference between a start tag (like ) and a self-terminating tag (like )
jamesatha
  • 7,280
  • 14
  • 37
  • 54
1
vote
1 answer

Performance: XmlTextReader vs LINQ to XML

I'm about to read some XML (who isn't :-)). This time however it's a lot of data: about 30,000 records with 5 properties, all in one file. Till now I've always read that the XmlTextReader is the fastest way to read XML data, but now there also is…
Michel
  • 23,085
  • 46
  • 152
  • 242
1
vote
1 answer

XMLTextReader get children

I new ti XML and I'm struggling with some basics. I have a XMLTextReader that reads through a document:
1
vote
3 answers

Hash character in path throws DirectoryNotFoundException

Consider the following code snippet private void ProcessFile(string fullPath) { XmlTextReader rdr = new XmlTextReader("file:\\\\" + fullPath); while (rdr.Read()) { //Do something } return; } Now, this functions fine when…
Nigel Hawkins
  • 824
  • 1
  • 8
  • 23
1
vote
0 answers

How to process nodes from XMLTextReader from a network stream as they are received (fragment at a time)?

I have a device that communicates over a persistent TCP socket using XML. Commands are sent to it in XML structure and responses are returned in XML form. The device outputs a root element open such as when connection is made. Each…
1
vote
0 answers

XmlTextReader & XmlNodeTypes

I'm working with the XmlTextReader and use a switch to determine which operations I want to do depening on the XmlNodeType. switch(xmlTextReader.NodeType) { case XmlNodeType.Element { ... break; } ... } and so…
Marco Frost
  • 780
  • 3
  • 12
  • 25
1
vote
2 answers

change an attribute value of a XML file in c#

how I can change the attribute "id" using my source code? static void Main(string[] args) { XmlTextReader reader = new XmlTextReader(@"C:\Users\1.xml"); XmlNodeList elementList = reader. while (reader.Read()) { …
Evgeny Bubnov
  • 77
  • 1
  • 6
1
vote
1 answer

C# Strip HTML Markup in XML

i really hope someone can help me with this issue. The solution should be on C#. I have a xml file with the size of 36 MB and with 900k lines. On some nodes it has a lot of html markup and some invalid markup like

blindado
  • 43
  • 7
1
vote
3 answers

Cleaning up memory after reading a giant xml element value

I rarely turn here for help, but this is driving me crazy: I'm reading an xml file that wraps an arbitrary number of items, each with a b64-encoded file (and some accompanying metadata for it). Originally I just read the whole file into an…
neminem
  • 2,658
  • 5
  • 27
  • 36
1
vote
2 answers

Can't read RSS feed with xmlTextReader - "A column named 'link' already belongs to this DataTable"

I've been using an xmlDataReader to read RSS for many years, but all of a sudden two feeds I've use have introduced an extra line which is tripping up the xmlDataReader parser. The problem is the second line here conflicts with the…
NickG
  • 9,315
  • 16
  • 75
  • 115
1 2 3
8 9