tagged [xmldocument]

Error :- The XmlReader state should be Interactive on XDocument.Load

Error :- The XmlReader state should be Interactive on XDocument.Load I get the following error :- > System.InvalidOperationException: The XmlReader state should be Interactive. at System.Xml.Linq.X...

14 Jan at 14:52

Removing nodes from an XmlDocument

Removing nodes from an XmlDocument The following code should find the appropriate project tag and remove it from the XmlDocument, however when I test it, it says: Does anyone know the proper way to do...

21 Aug at 17:47

How to modify existing XML file with XmlDocument and XmlNode in C#

How to modify existing XML file with XmlDocument and XmlNode in C# I already implemented to create the XML file below with when application initialization. And know I don't know how to update the chil...

12 Feb at 09:49

how to save xmldocument to a stream

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 dec...

17 Jan at 20:56

Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function

Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function I am trying to call `SelectNode` from `XmlDocument` class and trouble due to this error: > Namespac...

3 Jan at 16:20

Is there any way to save an XmlDocument *without* indentation and line returns?

Is there any way to save an XmlDocument *without* indentation and line returns? All my searches have brought up people asking the opposite, but I have a file which grows by nearly 50% if it is saved w...

10 Jul at 16:2

.NET XmlDocument : Why DOCTYPE changes after Save?

.NET XmlDocument : Why DOCTYPE changes after Save? I am opening a XML file using .NET XmlReader and saving the file in another filename and it seems that the DOCTYPE declaration changes between the tw...

12 Nov at 15:57

XmlNode.SelectSingleNode syntax to search within a node in C#

XmlNode.SelectSingleNode syntax to search within a node in C# I want to limit my search for a child node to be within the current node I am on. For example, I have the following code: ``` XmlNodeList ...

5 Aug at 00:4

Using XPath to parse an XML document

Using XPath to parse an XML document Lets say I have the following xml (a quick example) I am trying to parse this by using XmlDocument and XPath (ultimately so I can make a list of rows). For example...

21 Sep at 14:57

How to prevent blank xmlns attributes in output from .NET's XmlDocument?

How to prevent blank xmlns attributes in output from .NET's XmlDocument? When generating XML from XmlDocument in .NET, a blank `xmlns` attribute appears the first time an element an associated namespa...

12 Nov at 00:44

How to return XmlDocument as a response from a ServiceStack API

How to return XmlDocument as a response from a ServiceStack API We are having a few ServiceStack APIs which are being called from an external tool. This tool expects the input of "XmlDocument" type, a...

26 Apr at 12:15

How to Select XML Nodes with XML Namespaces from an XmlDocument?

How to Select XML Nodes with XML Namespaces from an XmlDocument? my code attempts to grab data from the RSS feed of a website. It grabs the nodes fine, but when attempting to grab the data from a node...

8 Jan at 16:3

XmlDocument Save keeps file open

XmlDocument Save keeps file open I have a simple c# function that creates a basic XML file and saves: ``` private void CreateXMlFile(string Filename, string Name, string Company) { XmlDocume...

17 Feb at 10:30

Documenting overloaded methods with the same XML comments

Documenting overloaded methods with the same XML comments Say I have this constructor: which has these overloads: ``` public SftpConnection(string host, string username, string password) : this(host...

How do I add multiple namespaces to the root element with XmlDocument?

How do I add multiple namespaces to the root element with XmlDocument? I need to create an `XmlDocument` with a root element containing multiple namespaces. Am using C# 2.0 or 3.0 Here is my code: ```...

1 Dec at 21:46

Getting specified Node values from XML document

Getting specified Node values from XML document I have a problem going through an XML document (with C#) and get all the necessary values. I successfully go through all specified XmlNodeLists in the X...

23 Jun at 15:43

Read typed objects from XML using known XSD

Read typed objects from XML using known XSD I have the following (as an example) XML file and XSD. and ``` version="1.0" encoding="utf-8"?>

C# : Modify a xml node

C# : Modify a xml node i have that xml file : And i want to modify the innertext from Alarm1 to another value so i wrote that code which actually d

8 Mar at 12:11

Serialize object to XmlDocument

Serialize object to XmlDocument In order to return useful information in `SoapException.Detail` for an asmx web service, I took an idea from WCF and created a fault class to contain said useful inform...

7 Feb at 01:18

Deciding on when to use XmlDocument vs XmlReader

Deciding on when to use XmlDocument vs XmlReader I'm optimizing a custom object -> XML serialization utility, and it's all done and working and that's not the issue. It worked by loading a file into a...

Can't get XmlDocument.SelectNodes to retrieve any of my nodes?

Can't get XmlDocument.SelectNodes to retrieve any of my nodes? I'm trying to parse an XML document. The document in question is an AppxManifest file. An example document looks like this: ```

26 Sep at 18:21

C# extracting data from XML

C# extracting data from XML I'm trying to read weather data from XML in a URL. The XML looks like this: ``` ... ... ... ... ...

14 Jul at 18:42