tagged [xml]

How do I make the value of an XElement be wrapped in ![CDATA[***]]?

How do I make the value of an XElement be wrapped in ![CDATA[***]]? This is when using XDocument from .net. I thought this might work... ... but it comes out like this...

2 Mar at 10:28

Meaning of - <?xml version="1.0" encoding="utf-8"?>

Meaning of - I am new to XML and I am trying to understand the basics. I read the line below in "Learning XML", but it is still not clear, for me. Can someone point me to a book or website which expla...

An XML viewer/editor that provides XPath for nodes

An XML viewer/editor that provides XPath for nodes I am an XSLT designer, and I find it hard to type XPath expressions of nodes manually. Is there any XML editor or viewer which can give me XPath expr...

28 May at 17:34

XDocument.Load(XmlReader) Possible Exceptions

XDocument.Load(XmlReader) Possible Exceptions What are the possible exceptions that can be thrown when `XDocument.Load(XmlReader)` is called? It is hard to follow best practices (i.e. avoiding generic...

1 Aug at 21:49

C# Adding a root to an XDocument

C# Adding a root to an XDocument I have a string that contains an XML, lets say like this: I want to make an XDocument that looks like this: I can load the xml string into an XD

25 Jul at 15:31

How to convert XElement to XDocument

How to convert XElement to XDocument How can I convert XElement into XDocument? Is there some built-in method for this? The only way I can think of is without `new XDocument(xelement.ToString())` whic...

6 Jul at 15:16

How to fix error: The markup in the document following the root element must be well-formed

How to fix error: The markup in the document following the root element must be well-formed I put my code in the XML validation website and it gives me this error: > Line 8: 4 The markup in the docum...

22 Sep at 01:43

What is the difference between Linq to XML Descendants and Elements

What is the difference between Linq to XML Descendants and Elements I have came across both these keywords in the VS IntelliSense. I tried to googling the difference between them and did not get a cle...

7 Oct at 12:20

How can I make the xmlserializer only serialize plain xml?

How can I make the xmlserializer only serialize plain xml? I need to get plain xml, without the `` at the beginning and `xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3....

How can I remove empty xmlns attribute from node created by XElement

How can I remove empty xmlns attribute from node created by XElement This is my code: After that I got this: Parent element hasn't any namespace. What can I do, to get an `Items` element without the e...

20 Aug at 14:30

how to use XMLRPC in C#

how to use XMLRPC in C# I need to make XMLRPC calls from my C# application and I failed to find any help with that. When I used XMLRPC from Ruby, it's that simple: is there any similar library for C#?

27 Sep at 20:35

How do I add a document type to an XDocument?

How do I add a document type to an XDocument? I have an existing XDocument object that I would like to add an XML doctype to. For example: I can create an XDocumentType using: But how do I apply that ...

11 Sep at 20:33

What is the fastest way to load XML into an XDocument?

What is the fastest way to load XML into an XDocument? When you create a new `XDocument` using `XDocument.Load`, does it open the XML file and keep a local copy, or does it continuously read the docum...

3 Apr at 11:50

How to get attribute in the XDocument object

How to get attribute in the XDocument object I have this xml I want my code to able to do something like this How do I do this with LINQ XDocument? What I have so far is the XDocument Object loaded wi...

26 Jun at 12:24

Best XML Parser for PHP

Best XML Parser for PHP I have used the XML Parser before, and even though it worked OK, I wasn't happy with it in general, it felt like I was using workarounds for things that should be basic functio...

30 Jun at 09:43

how to Check if a XML child element exists with Linq to XML

how to Check if a XML child element exists with Linq to XML How can I check if `IncomingConfig` element exists by use linq to xml? ``` 10.100.101.18 5060 tarek tarek ffff

10 Oct at 15:23

XDocument or XmlDocument

XDocument or XmlDocument I am now learning [XmlDocument](http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx) but I've just ran into [XDocument](http://msdn.microsoft.com/en-us/library...

19 Aug at 10:12

Convert single XElement to object

Convert single XElement to object I have a single `XElement` looking like this: Then I have a class looking like this: ``` public class ProductAttribute { public string Flag { get; set; } public s...

8 Apr at 07:23

xmlns=''> was not expected. - There is an error in XML document (2, 2)

xmlns=''> was not expected. - There is an error in XML document (2, 2) Im trying to deserialize the response from [this simple web service](http://inb374.jelastic.tsukaeru.net:8080/VodafoneDB/webresou...

1 Oct at 11:38

Converting XDocument to XmlDocument and vice versa

Converting XDocument to XmlDocument and vice versa It's a very simple problem that I have. I use XDocument to generate an XML file. I then want to return it as a XmlDocument class. And I have an XmlDo...

2 Oct at 09:29

Xml Serialization vs. "True" and "False"

Xml Serialization vs. "True" and "False" I'm having an issue with deserializing an XML file with boolean values. The source XML files I'm deserializing were created from a VB6 app, where all boolean v...

23 Apr at 08:40

LINQ to XML: applying an XPath

LINQ to XML: applying an XPath Can someone tell me why this program doesn't enumerate any items? Does it have something to do with the RDF namespace? ``` using System; using System.Xml.Linq; using Sys...

17 Oct at 20:6

Populate XDocument from String

Populate XDocument from String I'm working on a little something and I am trying to figure out whether I can load an XDocument from a string. `XDocument.Load()` seems to take the string passed to it a...

12 Mar at 13:36

Find Elements by Attribute using XDocument

Find Elements by Attribute using XDocument This query seems to be valid, but I have 0 results. My XML is as follows: ```

21 Apr at 20:27

Writing formatted XML with XmlWriter

Writing formatted XML with XmlWriter I'm trying to write to an XML file to the isolated storage but I would like to format it like this:- ```