xmlreader Questions

3

Solved

Does anyone know how I can get the current line number of an System.Xml.XmlReader? I am trying to record where in a file I find Xml elements.
Koblenz asked 7/3, 2009 at 0:58

4

Solved

I have a 150 MB XML file which is used as DB in my project. Currently I'm using XmlReader to read content from it. I want to know if it is better to use XmlReader or LINQ to XML for this scenario. ...
Phthalocyanine asked 29/4, 2010 at 7:20

3

I'm trying use XMLReaderFactory, but this is deprecated. Now, how Can I create a instance of XMLReader?
Illegal asked 27/6, 2018 at 22:45

4

Solved

I am writing an XML validator with XSD. Below is what I did, but when the validator reached the line while (list.Read()) it gives me the error There is no Unicode byte order mark. Cannot switc...
Drumfish asked 28/4, 2015 at 9:25

5

Solved

I have the following XML Parsing code in my application: public static XElement Parse(string xml, string xsdFilename) { var readerSettings = new XmlReaderSettings { ValidationType = Validatio...
Veridical asked 23/6, 2010 at 17:47

4

Solved

I am reading rss with xml reader. And when url is bad it takes 60 seconds to fail for it. How i can specify timeout? using (XmlReader reader = XmlReader.Create(url, settings))
Forworn asked 26/1, 2011 at 19:19

4

Solved

xml:19558: parser error : XML declaration allowed only at the start of the document any solutions? i am using php XMLReader to parse a large XML file, but getting this error. i know the file is no...
Pokorny asked 29/3, 2011 at 22:8

5

I am using a third-party DLL which transmits an XML document over the internet. Why would the DLL be throwing the following exception? Data at the root level is invalid. Line 1, position 1. (se...
Pantry asked 30/7, 2013 at 12:38

7

Solved

I have the following XML file, the file is rather large and i haven't been able to get simplexml to open and read the file so i'm trying XMLReader with no success in php <?xml version="1.0" enc...
Maice asked 2/12, 2009 at 19:17

6

Solved

I got this scenario: while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == itemElementName) { XElement item = null; try { item = XElement.ReadFrom(read...
Rameses asked 1/6, 2010 at 6:48

4

Solved

I'm getting this error when trying to parse through an XML document in a C# application: "For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDt...
Doroteya asked 13/12, 2012 at 6:16

6

Is there a way to get the current position in the stream of the node under examination by the XmlReader? I'd like to use the XmlReader to parse a document and save the position of certain elements...
Oaten asked 29/1, 2010 at 7:32

1

I have created an XMLReader object out of a Stream object which I was written to earlier by XMLWriter object. I know XMLReader object is forward only and therefore I want to be able to save curren...
Idiot asked 22/12, 2012 at 12:9

3

Solved

If the data is on a single line the index=int.Parse(logDataReader.ReadElementContentAsString()); and value=double.Parse(logDataReader.ReadElementContentAsString(), cause the cursor to move forwar...
Chandlery asked 28/4, 2018 at 17:15

4

Solved

Please note this question is specific to XmlReader and not whether to use XDocument or XmlReader. I have an XML fragment as: private string GetXmlFragment() { return @"<bookstore> <boo...
Unpractical asked 28/4, 2016 at 8:54

1

Solved

I'd like to parse one XML document using XMLReader. I have a case switch with all the Constants. However, if a Tag is self-closing XMLReader only fires ELEMENT, not ELEMENT and than END_ELEMENT lik...
Identity asked 2/8, 2017 at 9:35

1

Solved

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 documen...
Cara asked 31/7, 2017 at 11:16

5

Solved

When I use XmlReader.ReadOuterXml(), elements are separated by \n instead of \r\n. So, for example, if I have XmlDocument representatino of <A> <B> </B> </A> I get <A...
Centreboard asked 25/11, 2009 at 0:22

5

Solved

I've used the following code to create an XML file: XmlWriterSettings xmlWriterSettings = new XmlWriterSettings(); xmlWriterSettings.Indent = true; xmlWriterSettings.NewLineOnAttributes = true; us...
Defoliant asked 4/1, 2014 at 15:29

7

Solved

I'm trying to read the following Xml document as fast as I can and let additional classes manage the reading of each sub block. <ApplicationPool> <Accounts> <Account> <Name...
Amoroso asked 14/3, 2010 at 9:6

4

Solved

I've already written code to parse my xml file with an XmlReader so I don't want to rewrite it. I've now added encryption to the program. I have encrypt() and decrypt() functions which take an xml ...
Neurologist asked 1/10, 2012 at 15:37

5

Solved

I have some HTML that I'm converting to a Spanned using Html.fromHtml(...), and I have a custom tag that I'm using in it: <customtag id="1234"> So I've implemented a TagHandler to handle t...
Maybellmaybelle asked 5/8, 2011 at 6:22

2

Solved

To load XML files with arbitrary encoding I have the following code: Encoding encoding; using (var reader = new XmlTextReader(filepath)) { reader.MoveToContent(); encoding = reader.Encoding; } ...
Filmdom asked 12/3, 2009 at 9:26

2

Solved

I'm working with ASP.NET, and am importing an XML file from a form. Right now I convert that into a Stream: Stream inputStream = XmlFileUploadControl.PostedFile.InputStream; because I may need ...
Candlestick asked 5/7, 2013 at 20:6

3

Solved

XElement.Save actually does what I need but it starts the file with: <?xml version="1.0" encoding="utf-8"?> Is there a way to prevent this? Should I save using other types, methods after ...
Omland asked 25/2, 2011 at 23:25

© 2022 - 2024 — McMap. All rights reserved.