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
3 answers

C# What is the best way to compute a hash of an xml feed

I want to detect if a feed has changed, the only way I can think of would be to hash the contents of the xml document and compare that to the last hash of the feed. I am using XmlReader because SyndicationFeed uses it, so idealy I don't want to load…
superlogical
  • 14,332
  • 9
  • 66
  • 76
3
votes
1 answer

XmlReader not recognizing EndElement

I have an XML string that has no formatting similar to: tag 1tag 2tag 3tag 4 When I run this code: using (XmlReader reader = XmlReader.Create(stream)) { …
Adam
  • 3,014
  • 5
  • 33
  • 59
3
votes
2 answers

Change the encoding to UTF-8 on a stream (MemoryMappedViewStream)

I am using the code below to read a ~2.5Gb Xml file as fast as I can (thanks to MemoryMappedFile). However, I am getting the following exception: "'.', hexadecimal value 0x00, is an invalid character. Line 9778, position 73249406.". I beleive it is…
Martin
  • 39,309
  • 62
  • 192
  • 278
3
votes
1 answer

Why does XmlNamespaceManager return inconsistent results for HasNamespace?

I'm trying to process an XML document and determine which namespaces are defined in it but I'm having trouble getting consistent results from XmlNamespaceManager.HasNamespace. As it's reading through the document HasNamespace will return false even…
mford
  • 313
  • 2
  • 8
3
votes
3 answers

install XMLReader module extension ubuntu

Im working with a plugin that requires XMLReader, and XMLWriter PHP modules to be installed. So I need to activate the DOMDocument, XMLReader, and XMLWriter PHP modules. So far i have tried : sudo apt install php-xmlwriter apparently is installed…
Alejo_Blue
  • 603
  • 3
  • 12
  • 25
3
votes
1 answer

Using XmlReader in Vb.net how to handle when ReadToFollowing doesn't return a value

If I use xmlCommand.ReadToFollowing("A") valueA = xmlCommand.ReadElementContentAsString xmlCommand.ReadToFollowing("B") valueB = xmlCommand.ReadElementContentAsString If there is no Element A then I get a The ReadElementContentAsString method is…
mellerbeck
  • 199
  • 2
  • 14
3
votes
1 answer

How to read in an XML file asynchronously?

I am writing a Windows Form Application for data post-processing. I have a panel where I allow for files to be dragged and dropped. The XML files will be quite large (enough to slow the UI down). Therefore I would like to read the file in…
G. LC
  • 794
  • 1
  • 8
  • 27
3
votes
3 answers

PHP XMLReader getting parent node?

While parsing an XML File using the XMLReader Method, how do I get the parent node of an element ? $xml = new XMLReader(); $xml->XML($xmlString); while($xml->read()) { $xml->localName; // gives tag name $xml->value; // gives tag value // how do I…
Zaje
  • 2,281
  • 5
  • 27
  • 39
3
votes
1 answer

XmlReader chopping off whitespace after ampersand entity?

This is strange. I've got a WCF Message and I'm trying to read the contents of the body into an XmlDocument. The contents of the message body look like this on the wire (when inspected with WCF tracing turned on): (GMT-05:00)…
Mike Atlas
  • 8,193
  • 4
  • 46
  • 62
3
votes
1 answer

Read/Write large XMLs without using too much memory in PHP

I'm trying to query some very large XML files (up to several gig), check them for being well-formed, and write them to hard disk. Seems easy, but as they are so large I can not have a whole document in the memory. Therefore my question is: How can I…
Marco
  • 550
  • 2
  • 6
  • 22
3
votes
1 answer

c# XmlReader: reading attributes from start element

I am trying to save the state of a game in an xml file, so that it can be restored when the player loads the game. I am brand new to xml, but I did manage to succesfully store the state of the game in an xml file using the XmlWriter. The problem…
D-Inventor
  • 450
  • 5
  • 23
3
votes
3 answers

c# simple xml reader skips every other element

Hi all I have attempted to write a simple xml reader but have found that it unintentionally skips every other element in the xml file. Im guessing I am telling it to move onto the next element twice but I am unsure how whats happening or what the…
Iain
  • 35
  • 1
  • 4
3
votes
2 answers

IgnoreWhiteSpace not ignoring whitespace at beginning of xml string

Question Should whitespace be ignored at the beginning of my multi-line string literal xml? Code string XML = @" " using (StringReader stringReader = new StringReader(XML)) using (XmlReader…
George Grainger
  • 172
  • 2
  • 15
3
votes
5 answers

xml, xmlreader read only specific part using c#

I'm using c# to get a parameters from xml file. My problem is I want to read only for the current program parameters. (v1.0, v1.1, v1.2... )
Smith
  • 123
  • 1
  • 11
3
votes
1 answer

Ignore XML doctype declarations in XMLReader (XXE)

I use the non-validating read for displaying or processing un-trusted XML documents where I do not need support for internal entities but I do want to be able to process then even if a DOCTYPE is shown. With the disallow DOCTYPE-decl feature of SAX…
eckes
  • 10,103
  • 1
  • 59
  • 71