xmlreader

XMLResolver Compile Errors

So, I'm trying to use XMLResolver to load an xml file. It works fine when I create an xmlreader from a filename but fails when I do so using a stringreader. It gives me an XslLoadException: XSLT compiler error. The inner exception is "An entry with the same key already exists." public override object GetEntity(Uri absoluteUri, str...

what do i have to do to work with xml in vb.net?

i am trying to use xmlreader and all of those, but i do not know how to reference or import them. i am beginner so please be gentle. thanks! ...

Parsing XML structure without expanding entities in PHP

I'm trying to extract the structure of an XML document in PHP without expanding the entities within. I'm aware that entities are usually expanded before the structure is parsed, and that ignoring this means that the XML may not be well-formed, but I'm parsing XML fragments which might not include the normal XML document header, and so wi...

XmlReader and IDisposable

Perhaps my eyes are fooling me, but how is it that in .NET 2.0, XmlReader implements Dispose but does not have a Dispose() method? I see it has Dispose(bool), but not a parameterless overload. ...

How can I read all elements in a plain XML using XMLReader in .Net 2.0?

I have the following XML: <XMLDictionary> <a>b</a> <c>d</c> <e>f</e> </XMLDictionary> I'm trying to get the mappings a: b, c: d, e: f, and I can't quite find how to do it simply. My current code looks like this: Do While reader.Read() If reader.NodeType = Xml.XmlNodeType.Element Then Me.Add(reader.Name, reader.ReadElemen...

XmlReader DTD Validation Error on an Attribute

I am trying to use XmlReader to parse a file and set each element's attributes to variables using reader.GetAttribute("atrribute_name"), but the elements may or may not actually have that attribute present, so some elements give me an error...I would have expected it would just return null when the attribute is not present, but instead i...

LINQ to XML vs. XmlReader

In my Silverlight application I'm using mostly XmlReader but I'm playing with idea to replace XmlReader implementation with LINQ to XML. What are pros and cons between LINQ to XML and XmlReader in Silverlight? ...

php open gzipped xml

Hi, I am struggling to read gzipped xml files in php. I did succeed in reading normal xml files, using XMLReader() like this: $xml = new XMLReader(); $xml->open($linkToXmlFile); However, this does not work when the xml file is gzipped. How can I unzip the file and read it with the XMLReader? ...

Schema with xsd:any - XmlReader validation error

I have problem with types in my schema when trying to use xsd:any element During validation i've got validation exception: The 'MerchantAccount' element is not declared. The idea is to have ability to specify any properties and values within ExtendedProperties element. Please advice what am i doing wrong. Part of the schema ... <xsd:...

how to create rss reader with php?

i am creating rss reader application with php.it is basicly getting rss url's from user and with php i am creating an rss reader.But i have some problems how to get rss content with php i try to use pear extension but i had some problem with that.it would be good that seeing some sample code or example application source code which not s...

Join xml files with XmlReader

I am joining 3 xml logfiles with LINQ to XML by id, but when my logfiles become too big, LINQ to XML doesn't work anymore, so i have to use XmlReader. But now I am asking myself how to do this? Should i loop through every document for each id, or is there a more simple elegant solution? Anybody? ...

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 data from mtomReader's element?? string elementString = mtomReader.XmlReader.ReadElement...

XmlReader - I need to edit an element and produce a new one

I am overriding a method which has an XmlReader being passed in, I need to find a specific element, add an attribute and then either create a new XmlReader or just replace the existing one with the modified content. I am using C#4.0 I have investigated using XElement (Linq) but I can't seem to manipulate an existing element and add an a...

Does XmlMtomReader cache binary data from the input stream internally?

Actually i'd like to know if XmlMtomReader reads mime binary parts from the input stream directly? Or does it store them internally before i call ReadContentAsBase64() method? ...

Are XmlMtomReader and XmlMtomWriter fully implemented in Mono project?

I'm working on a cross-platform solution currently. The solution uses XmlMtomReader and XmlMtomWriter from .NET framework 3.0. Now i need to know if these two classes (and all the nessasary infrastructure around them) are fully supported in Mono project from the porting-it-to-linux point of view. :) ...

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'. An explicit conversion exists(are you missing a cast?). pomfile is of type FileInfo ...

What's XmlNodeType.Document ? Difference between XmlNodeType.Element and XmlNodeType.Document

Hi, I am using XmlReader to read an XML File and I want to count XML Element right under of Document Element that as I know it should be the root element. XML <?xml version="1.0" encoding="utf-8"?> <NewsLetters> <EMail Date="10/10/2009">[email protected]</EMail> <EMail Date="10/10/2009">[email protected]</EMail> <EMail Date="10/10...

Efficiency of deserialization vs. XmlReader

I'm working with a complicated xml schema, for which I have created a class structure using xsd.exe (with some effort). I can now reliably deserialize the xml into the generated class structure. For example, consider the following xml from the web service: <ODM FileType="Snapshot" CreationDateTime="2009-10-09T19:58:46.5967434Z" ODMVer...

How to build XmlNodes from XmlReader

I am parsing a big number of big files and after profiling my bottleneck is: XmlDocument doc = new XmlDocument(); doc.Load(filename); This approach was very handy because I could extract nodes like this: XmlNodeList nodeList = doc.SelectNodes("myXPath"); I am switching to XmlReader, but When I find the element I need to extract I a...

XmlReader is {None} on web service call (.Net C#)

I have a method which creates HttpWebRequest for a given url and returns XmlReader object with the response stream. HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); req.Accept = "*/*"; req.Headers.Add("UA-CPU", "x86"); req.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; MS-RTC LM 8)"; Ht...