Questions tagged [xmlreader]

xmlreader - Represents a reader that provides fast, noncached, forward-only access to XML data.

Represents a reader that provides fast, noncached, forward-only access to XML data.

More

1120 questions
3
votes
1 answer

Why doesn't my XmlReader.GetAttribute() return a value?

I'm trying to parse my XML in C#. Here's part of the file that is relevant: ... Here's the code that is supposed to read it: while (reader.Read()) { if…
Lazlo
  • 8,518
  • 14
  • 77
  • 116
3
votes
3 answers

xmlreader, get the attribute's name

I want to do something like: stringBuilder.AppendLine(" globalVar." + reader.GetAttribute(i).Name + " = " + reader[i] + "; //add param "); Where "reader.GetAttribute(i).Name" is the component that doesn't work. Is there an equivalent method to…
yoyo
  • 79
  • 3
  • 11
3
votes
1 answer

Reading inner XML without namespaces

I am trying to read inner XML of the root element as string but XmlReader class is namespace aware. Is there any way to ignore the namespaces? I can use any class in BCL as long as it passes the NUNit test below. [Test] public void…
Ufuk Hacıoğulları
  • 37,978
  • 12
  • 114
  • 156
3
votes
1 answer

how to parse XML using XmlReader along with their closing tags?

Consider the following XML which I have to parse. 001 test 1 I have to parse each of its tag and store it into a table as follows: TAG_NAME …
Aamir
  • 1,747
  • 5
  • 26
  • 50
3
votes
2 answers

C# app supposed to be asynchronous but UI still freezes

I have created a small C# application that should pull all values from an XML file asynchronously. The problem is.. it's not asynchronous and I can't see where I'm going wrong. When the button is clicked the UI freezes, the application can't be…
jskidd3
  • 4,609
  • 15
  • 63
  • 127
3
votes
2 answers

Using CURL output with php XML functions to process large data feeds

Im having a feed that is password protected. Below is the code used to access the feed $url = 'http://thefeedwebsite.com/feed.php'; $data = array("username" => ‘user’, "password" => ‘password’, "location" => "HK") $ch =…
3
votes
1 answer

PHP XMLReader, get the version and encoding

I'm currently rewriting a PHP class that tried to split an XML file into smaller chunks to use XMLReader and XMLWriter instead of the current basic filesystem and regex approach. However, I can't figure out how to get the version, encoding and…
GordonM
  • 31,179
  • 15
  • 87
  • 129
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
3 answers

XmlMtomReader reading strategy

Consider the following code: Stream stream = GetStreamFromSomewhere(); XmlDictionaryReader mtomReader =XmlDictionaryReader.CreateMtomReader ( stream, Encoding.UTF8, XmlDictionaryReaderQuoatas.Max ); /// ... /// is there best way to read binary…
sh0gged
  • 509
  • 2
  • 7
  • 17
3
votes
1 answer

Read multiple consecutive XML files in C#'s XmlReader

Possible Duplicate: Is there a built-in way to handle multiple files as one stream? I have an extremely large amount of consecutive data split into multiple files. Using XmlDocument or LINQ are not options because these files are huge and loading…
Allison A
  • 5,575
  • 6
  • 28
  • 32
3
votes
2 answers

Read/Write Enum to/from XML

I'm writing an enum value with an XmlWriter, and it look something like this in the xml: Plain writer.WriteValue(tile.ID.ToString()); // ID's type is the enum Plain being one of the enum values. Now when I try to read this, though it…
The Oddler
  • 6,314
  • 7
  • 51
  • 94
3
votes
1 answer

PHP XMLReader parses lines 2 times

i'm parsing a xml file. When i output one attribute for instance, i always get the result 2 times. here is some simplified code of what i do: $xml = new XMLReader(); $xml->open($file); while ($xml->read()) { if ($xml->name ==…
Megamind
  • 251
  • 2
  • 16
3
votes
3 answers

parsing almost well formed XML fragments: how to skip over multiple XML headers

I’m required to write a tool that can handle the below XML fragment that is not well formed as it contains XML declarations in the middle of the stream. The company already has these kinds files in use for a long time, so there is no option to…
Jeroen Wiert Pluimers
  • 23,965
  • 9
  • 74
  • 154
3
votes
1 answer

How to use XMLReader in TagHandler.handleTag(...)

I am trying to add lists (
    ,
      ) to TextView. Usually you load HTML to TextView with textview.setText(Html.fromHtml("some String with HTML in it")); but that does not work for all HTML tags. You can extend support for different tags with…
Kuitsi
  • 1,675
  • 2
  • 28
  • 48
3
votes
3 answers

xmlreader.Create return none

i am trying to read from xml string But , ` XmlReader reader=XmlReader.Create(new StringReader(stringXml)` reader is always none. why is reader objest none ?
Tractatus
  • 118
  • 1
  • 1
  • 9