How do I load an XML formatted string into an XElement
I want to pass a varying number of parameters between two objects. I have a method on the receiving object that accepts a single string parameter. The sending object will be sending a string representation of an XElement.
Here is a sample string with one parameter specified:
<parameters><parameter Name="Code" Type="string" Value="007" /></parameters>
More parameters will be sent as additional <parameter>
entries between the <parameters></parameters>
tags.
What is the simplest way to load this string into开发者_C百科 an XElement?
And before we go down the just-send-the-XElement-to-the-receiver road, let me just say that there is COM in the middle, so I don't want to open that can of worms.
XElement x = XElement.Parse(xmlstring);
精彩评论