Questions tagged [xmltextreader]
126 questions
0
votes
1 answer
Using XmlTextReader to read attributes from element
In the code below, I'm finding the "Undly" element and then setting the appropriate attributes to a class. Is that the correct way to do it? Or should I be creating a new XElement class and then finding the attributes?
I'm still learning about the…

rds80
- 631
- 1
- 10
- 23
0
votes
1 answer
Copy fragment from XmlTextReader using XmlTextWriter
As I read an XML file using XmlTextReader, I sometimes need to save off a node, and it's children. I do this using XmlTextWriter (I'm not married to this approach).
The problem is XmlTextReader is aware of a bunch of namespaces that this fragment…

David Thielen
- 28,723
- 34
- 119
- 193
0
votes
0 answers
xmlTextReader error when accessing online file
I created a method in console to read an online xml file and it worked just fine. Transfer the same code to a windows form application and I get the following error:
Exception thrown: 'System.Net.WebException' in System.Xml.dll
The underlying…

shags_j
- 11
- 2
0
votes
1 answer
Integer Exception from XmlTextReader read
I get an error when reading an XML file using XmlTextReader. First, the URL is normal, but the second URL fails. It is normal to use other URL. Only this URL has an error.
Dim url As String
'url = "http://test.damiedu.net/testxml.xml"
…

ej_lee
- 1
0
votes
2 answers
How can I replace a date in an Xml string using C#?
I am trying to parse an XML RSS feed need to convert the date in an element from this:
Thu, 13 Apr 2017
to this:
Thu, 13 Apr 2017 09:00:52 +0000
I am able to get hold of the…

Vinyl Warmth
- 2,226
- 3
- 25
- 50
0
votes
1 answer
XmlTextReader is ignoring DtdProcessing flag
I am trying to load xml content using XmlTextReader but for some reason, XmlTextReader is ignoring DtdProcessing flag while processing Xml. DtdProcessing flag is working fine if I use XmlReader instead. Problem with XmlReader is that it…

Firoz Ansari
- 2,505
- 1
- 23
- 36
0
votes
0 answers
.Net XML parsing with optional internal (sub)tags, am I doing this right?
Shipping is a feature, and this is working... but I have a very strong feeling there is a much easier way to do this that will let me do similar things in the future much more easily, so here I am...
I'm reading an Excel sharedstrings file that…

Maury Markowitz
- 9,082
- 11
- 46
- 98
0
votes
1 answer
ReadOuterXml() adds format attribute tag to my data
I have the classic XmlTextReader problem where I need to process the tag as a whole as well as child within it. So what I did was this:
AllRD = New XmlTextReader(New StringReader(XMLString.Trim())) ' an entire file
Do While AllRD.Read()
... loop…

Maury Markowitz
- 9,082
- 11
- 46
- 98
0
votes
0 answers
Using delete for C++/CLI handles
I've found that C++ / CLI handles isn't neccessary to delete, but when I use XML Reader to load XML to memory and than try to save edited XML it sometimes failed. Can anyone describe me why? Or when is required to use delete and when not? On MSDN…

scarabeus
- 43
- 3
0
votes
3 answers
WPF - Searching an XML doc for values using XMLTextReader
Ok another WPF question, well I guess this is just general .NET. I have an xml document retreived from a URL.
I want to get multiple values out of the document (weather data, location, some other strings).
When I use the XmlTextReader I can call my…

John Batdorf
- 2,502
- 8
- 35
- 43
0
votes
0 answers
How to see xml child nodes in XmlTextReader
I'm reading through a large XML file and parsing it into HTML.
My current challenge is that child nodes can contain information regarding its parent. If you look at the code below, the panel is its own XML node and can contain XML attributes that…

Andrew Nielsen
- 113
- 1
- 8
0
votes
2 answers
XmlTextReader reads every second bulk of specific node
Below find xml sample and code i am using. When i was using with WhiteSpacehandling = None then out from 4 books records i was receiving only 2 (every second book). Solution i found was to use WhiteSpaceHandling set to WhiteSpacehandling = All -…

Arie
- 3,041
- 7
- 32
- 63
0
votes
2 answers
Read element within elements using XmlTextReader
I am reading XML data and retrieving the values based on the element. There is one element named which can have child element called . I want to read those values and add it to the ObservableCollection. If there are…

GThree
- 2,708
- 7
- 34
- 67
0
votes
1 answer
single expression to read value of element in XmlTextReader
consider the part of xml file.
Value
i used XmlTextReader to read xml file. so i used while(reader.Read())
now when i reach Element i want to get its Value.
if(reader.NodeType == XmlNodeType.Element && reader.LocalName ==…

M.kazem Akhgary
- 18,645
- 8
- 57
- 118
0
votes
1 answer
How do I get the full name of the Xml Node
I have a sample xml file that looks like this.

PaperWings
- 3
- 2