xmldocument

Why does overwriting an XML file create an extra end tag?

倖福魔咒の 提交于 2019-12-24 01:04:40
问题 I am creating an application in C# that has to write some user settings to an XML file. They are read perfectly fine, but when I try to write them back they create an extra end tag that the program cannot read. XML file: <?xml version="1.0" encoding="utf-8" ?> <options> <fullscreen>False</fullscreen> <resolutionX>1280</resolutionX> <resolutionY>720</resolutionY> <vsync>True</vsync> <AA>2</AA> <musicvolume>0</musicvolume> <soundvolume>0</soundvolume> </options> Code that writes: FileStream

Memory Leak with XmlDocument()

╄→гoц情女王★ 提交于 2019-12-23 22:39:20
问题 I believe I have memory leak with some of my code that uses the XmlDocument class. My program runs on a Windows 6.1.4 device (C#) and reads from a database on another server to see if any programs installed on the device need to be uninstalled and then reads from an XmlDocument to get the names of the programs that are uninstallable. The program then matches the lists and uninstalls accordingly, if necessary. This process is looped infinitely and runs in the background but what I'm noticing

HTML Documentation

那年仲夏 提交于 2019-12-23 17:36:04
问题 Is there a tool to generate HTML pages from XML Documentation files generated by VS2010? I searched google for such a tool, but couldn't find one. I downloaded and installed SandCastle, but I couldn't understand how to use it. 回答1: Try using the Sandcastle Help File Builder, it adds a UI over sandcastle :) 来源: https://stackoverflow.com/questions/7148210/html-documentation

Escaping new-line characters with XmlDocument

余生颓废 提交于 2019-12-23 15:43:58
问题 My application generates XML using XmlDocument. Some of the data contains newline and carriage return characters. When text is assigned to an XmlElement like this: e.InnerText = "Hello\nThere"; The resulting XML looks like this: <e>Hello There</e> The receiver of the XML (which I have no control over) treats the new-line as white space and sees the above text as: "Hello There" For the receiver to retain the new-line it requires the encoding to be: <e>Hello There</e> If the data is applied to

Does XPath do short-circuit evaluation of logical expressions?

妖精的绣舞 提交于 2019-12-23 11:49:02
问题 My question is regarding the order of execution in XPath. I have an expression such as: //person[@created and customFunction(.)] My problem is that my custom function is quite compute heavy and I only wish for it to run on nodes that have the created attribute set. Will @created always be evaluated before customFunction ? I could cook up a program to test this, but in reality the success of such an experiment is no guarantee, at least not in the long term. If this is a matter of XPath

Does XPath do short-circuit evaluation of logical expressions?

懵懂的女人 提交于 2019-12-23 11:48:40
问题 My question is regarding the order of execution in XPath. I have an expression such as: //person[@created and customFunction(.)] My problem is that my custom function is quite compute heavy and I only wish for it to run on nodes that have the created attribute set. Will @created always be evaluated before customFunction ? I could cook up a program to test this, but in reality the success of such an experiment is no guarantee, at least not in the long term. If this is a matter of XPath

System.Xml.XmlException - Root element is missing

风格不统一 提交于 2019-12-23 11:23:33
问题 I am making a web application that takes RSS feeds from websites(URLs are in database) and then loads them into my web application. But I am getting this error System.Xml.XmlException: Root element is missing. root element is missing. at line : rssdoc.load(rssStream); Exception Details: System.Xml.XmlException: There are multiple root elements. Line 2, position 2. so how to encapsulate everything else by single xml element Here is my code: using System; using System.Collections.Generic; using

Performance: XmlSerializer vs XmlReader vs XmlDocument vs XDocument

蹲街弑〆低调 提交于 2019-12-23 09:38:42
问题 I'm working on a little web project and would like to read/write to an XML file. Performance is my first priority. I've come to this great post on comparing the mentioned approaches except XmlSerializer . I prefer XmlSerializer since it makes the code much cleaner. But I don't know about its performance. What kind does XmlSerializer use inside to write to XML files? 回答1: As for the performance of XmlSerializer, see http://msdn.microsoft.com/en-us/library/182eeyhh.aspx which says: The

Library to generate .NET XmlDocument from HTML tag soup

无人久伴 提交于 2019-12-22 19:54:05
问题 I'm looking for a .NET library that can generate a clean Xml tree, ideally System.Xml.XmlDocument, from invalid HTML code. I.E. it should make the kind of best effort guesses, repairs, and substitutions browsers do when confronted with this situation, and generate a pretend XmlDocument. The library should also be well-maintained. :) I realize this is a lot (too much?) to ask, and I would appreciate any useful leads. There seem to be a fair number of implementations of this for Java, but I

Library to generate .NET XmlDocument from HTML tag soup

回眸只為那壹抹淺笑 提交于 2019-12-22 19:53:16
问题 I'm looking for a .NET library that can generate a clean Xml tree, ideally System.Xml.XmlDocument, from invalid HTML code. I.E. it should make the kind of best effort guesses, repairs, and substitutions browsers do when confronted with this situation, and generate a pretend XmlDocument. The library should also be well-maintained. :) I realize this is a lot (too much?) to ask, and I would appreciate any useful leads. There seem to be a fair number of implementations of this for Java, but I