views:

227

answers:

2

I am following a VB tutorial to do some HTML manipulation using LINQ

It has the following construct

Imports <xmlns="http://www.w3.org/1999/xhtml"&gt;

How do I do the same in C#?

There appears to be something called an XMLNamespaceManager that may hold the solution, but I am too foolish to understand how to work it, and I am not sure it is the correct tree to bark up.

Got any advice?

+2  A: 

VB.Net has a feature called XML Literals that is not present in C#. This import statement adds a namespace for use with those literals.

In researching this information, I found this link helpful:
http://blogs.msdn.com/bethmassi/archive/2007/10/30/quickly-import-and-export-excel-data-with-linq-to-xml.aspx
It's also very informative for working with Excel xml docs, but that's a side issue ;)

Joel Coehoorn
+1  A: 

I think the example you're looking at may be using XML literals, which are not supported in C#.

Brian Sullivan