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
17
votes
4 answers

how to save xmldocument to a stream

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 document and the encryption algorithm. I have a…
user1711383
  • 778
  • 2
  • 11
  • 20
16
votes
6 answers

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 =…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
15
votes
5 answers

xmlreader newline \n instead of \r\n

When I use XmlReader.ReadOuterXml(), elements are separated by \n instead of \r\n. So, for example, if I have XmlDocument representatino of I get \n\n\n Is there an option to specify newline character?…
user156144
  • 2,215
  • 4
  • 29
  • 40
14
votes
1 answer

Invalid URI: The Uri string is too long

I am trying to grab a schema and validate against my xml. XmlReaderSetting settings = new System.Xml.XmlReaderSettings(); settings.Schemas.Add(null, "http://example.com/myschema.xsd"); settings.ValidationEventHandler += new…
chobo2
  • 83,322
  • 195
  • 530
  • 832
14
votes
2 answers

Error Serializing String in WebService call

This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below ************** Exception Text ************** System.ServiceModel.CommunicationException: Error in deserializing…
MikeScott8
  • 720
  • 2
  • 10
  • 17
13
votes
1 answer

Replacing the innertext of an Xml node/element

First of all this is C#. I am creating a internet dashboard for a small group of colleages in the NHS. Below is an example xml file in which I need to change the innertext of. I need to replace a specific element for example "Workshop1." Because we…
Marshal
  • 1,177
  • 4
  • 18
  • 30
13
votes
4 answers

How to use XmlReader class?

I want to save and load my xml data using XmlReader. But I don't know how to use this class. Can you give me a sample code for start?
mohammad reza
  • 3,292
  • 6
  • 29
  • 39
13
votes
5 answers

How to get an attribute from an XMLReader

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: So I've implemented a TagHandler to handle this custom tag, like so: public void handleTag( boolean…
Jason Robinson
  • 31,005
  • 19
  • 77
  • 131
13
votes
2 answers

C# XMLreader and child nodes

I have this xml file. 8.582207 3 true false
k787
  • 397
  • 2
  • 5
  • 11
13
votes
4 answers

Problem - XML declaration allowed only at the start of the document

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 not well formatted but i think its not possible to go…
Aamir
  • 273
  • 2
  • 5
  • 10
13
votes
2 answers

How to create an XML file from a XmlReader?

How do you write an XML file from an System.Xml.XmlReader? I thought this would be a simple question but whenever I search I seem to be ending up with reading the file to a reader or writing node by node. The XmlReader object conveys xml that was…
Andy
  • 2,248
  • 7
  • 34
  • 57
13
votes
6 answers

How to read from an XmlReader without moving it forwards?

I got this scenario: while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == itemElementName) { XElement item = null; try { item = XElement.ReadFrom(reader) as XElement; …
andy
  • 8,775
  • 13
  • 77
  • 122
11
votes
2 answers

How use XMLReaderFactory now? because this is deprecated

I'm trying use XMLReaderFactory, but this is deprecated. Now, how Can I create a instance of XMLReader?
Igor Rodrigues
  • 131
  • 1
  • 8
11
votes
2 answers

Reading XML from Stream

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 this version later. I'd like to first check to make…
Adam_G
  • 7,337
  • 20
  • 86
  • 148
11
votes
5 answers

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…
Phill Duffy
  • 2,805
  • 3
  • 33
  • 45
1
2
3
74 75