Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: LINQ to XML [Thread Next] Re: LINQ to XMLTo: NULL Date: 6/12/2008 4:06:00 PM
Scott M. wrote:
>> Here is how you can do it, using Joe's suggestion:
>>
>> XElement desc = XElement.Load(@"file.xml");
>> XElement data = XElement.Parse("<data>" + desc.Value + >
>> "</data>");
>> Console.WriteLine(data.Value);
>
> I think this is close, but the XML is not in a file, so I can't use your
> .Load() suggestion to establish the desc variable. How could I do this with
> XMl that is being brought in from a dynamic source?
What is a "dynamic source"?
http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement.load.aspx
also has overloads taking a TextReader or an XmlReader.
If you have a string with XML then use
XElement desc = XElement.Parse(stringWithXml);
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
