Questions tagged [xmltextreader]

126 questions
3
votes
3 answers

convert xml to html using php

I want to convert xml data into html. Below is sample xml data and I want to get/convert it in html format.  
                 

ten post…

gautamlakum
  • 11,815
  • 23
  • 67
  • 90
3
votes
1 answer

why does xmltextreader convert html encoded utf8 characters to utf8 string automatically?

I receive an XML file with encoding "ISO-8859-1" (Latin-1) Within the file (among other tags) I have Example "content" And ─ Now for some reason when I load this into XMLTextReader and do a "XmlReader.Value" to…
AcidRaZor
  • 566
  • 4
  • 9
3
votes
0 answers

Why XmlTextReader skip lines after style:name="T103" closing tag?

My program is meant to read content.xml file. So after it read style:name="T103" closing tag, it will use reader.Read() function and then it jumps to tag. Skipping everything to that tag. Why is that?
Jon Koivula
  • 899
  • 1
  • 11
  • 24
3
votes
3 answers

convert XmlReader to XmlTextReader

How do you convert XmlReader to XmlTextReader? Code Snippet: XmlTextReader reader = XmlTextReader.Create(pomfile.FullName); Here's the Build error I got: Cannot implicitly convert type 'System.Xml.XmlReader' to 'System.Xml.XmlTextReader'.…
user186222
3
votes
4 answers

Try-Catch statement ends While loop reading through an XML file in C#

I have a while loop going through an XML file, and for one of the nodes "url", there are sometimes invalid values within it. I put a try-catch statement around this to catch any invalid values. The problem is, whenever an invalid value is grabbed…
Ryan Duffing
  • 664
  • 3
  • 11
  • 20
2
votes
2 answers

"Extra content at the end of the document" error using libxml2 to read from file handle created with shm_open

I'm trying to write a unit test that checks some xml parsing code. The unit test creates a file descriptor on an in-memory xml doc using shm_open and then passes that to xmlTextReaderForFd(). But I'm getting an "Extra content at the end of the…
Skeets
  • 1,252
  • 11
  • 16
2
votes
1 answer

How to check if certain Node Attribute has Children? If there is none, returns "false". Otherwise, returns "true"

Here's the xml file I am trying to check if it has child nodes triggered by TreeView SelectedNode on Database node:
RickyBelmont
  • 619
  • 4
  • 11
2
votes
1 answer

How to determine how much data have been read by XmlTextReader?

As I'm processing the XML, how can I determine how much data I have already processed, whether in bytes or in characters? If the underlying stream were a FileStream, it would be easy. How can I do it with an underlying NetworkStream? Performance…
Igor Pashchuk
  • 2,455
  • 2
  • 22
  • 29
2
votes
1 answer

Reading XML file faster in ASP.NET

I have multiple XML files that I need to parse. Problem is that I only need some data in the last couple of lines. I currently use XMLTextReader and reader.ReadToFollowing("DATANEEDED"); but it is still too slow. Does anyone know if I can 'tail'…
xt_20
  • 1,406
  • 3
  • 13
  • 27
2
votes
1 answer

Using XhtmlTextWriter with XmlTextReader

After reading this article, I have decided to update the following code (using XmlDocument) with XmlReader: Rendering controls public string Rendering(Control baseControl) { StringBuilder stringBuilder = new StringBuilder(); using…
Annie
  • 3,090
  • 9
  • 36
  • 74
2
votes
2 answers

VB.net Read XML file with wrong encoding

I've been looking for several hours now with no success! I have a XML file (which a program creates) and I like to get information out of it. Now, my problem is, the header of the files sais UFTF-8, but the file is encoded in UNICODE! VB.net…
gilu
  • 197
  • 2
  • 9
2
votes
2 answers

How to remove all instances of a character from a file in C#?

I am processing XML files from a third party. These files occasionally have invalid characters in them which causes XMLTextReader.Read() to throw an exception. I am currently handling this with the following function: XmlTextReader…
Kevin
  • 7,162
  • 11
  • 46
  • 70
1
vote
1 answer

XmlTextReader - How to iterate through nodes

I need help with cycling through nodes of a XML document using XmlTextReader. Using anything else besides XmlTextReader is not an option, unfortunately. My code: class Program { private static void Main(string[] args) { …
user1104783
  • 155
  • 2
  • 11
1
vote
1 answer

how to load a hashtable from a simple xml file using xmltextreader

using xmltextreader, how would I load a hashtable. XML: 2342343239099393 This was asked before but it was using some funky linq that I am not fully comfortable with just yet.
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
1
vote
0 answers

SMS HTTP API call from ASP.NET is slow

For a web application, I am creating a SMS module that can send an SMS from the application. My SMS provider has an API that I can call over HTTP. The API is called via an XmlTextReader who just reads the XML response from the API. Now my problem…
1
2
3
8 9