i have been using xml serialization for some time now and it works great.
I do something like this :
System.IO.StringReader stringReader = new System.IO.StringReader((string)result.xml.ToString());
System.Xml.XmlTextReader xmlReader = new System.Xml.XmlTextReader(stringReader);
System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(dataobject));
dataobject personSearchReturnDataConfiguration = (dataobject)xs.Deserialize(xmlReader);
This works fine when the xml looks the same all the time.
But what if the xml is dynamic and looks something like this :
Member
8 Points
148 Posts
xml serialization with dynamic xml
Dec 14, 2011 07:20 AM|dreamzor|LINK
Hi.
i have been using xml serialization for some time now and it works great.
I do something like this :
Member
162 Points
98 Posts
Re: xml serialization with dynamic xml
Dec 14, 2011 07:54 AM|bhasi83|LINK
Hi,
You can definetely acheive this.
in the definition of ur dataobject class, just you XMLElement property and configure the name for each of the class properties when it serializes.
Bhaskar Ravindranth
Contributor
6062 Points
1896 Posts
Re: xml serialization with dynamic xml
Dec 15, 2011 04:24 AM|kavita_khandhadia|LINK
Try this http://kavstech.blogspot.com/2009/07/about-xml-serialization.html
I would love to change the world, but they wont give me the source code.
All-Star
94120 Points
18123 Posts
Re: xml serialization with dynamic xml
Dec 15, 2011 08:41 PM|Decker Dong - MSFT|LINK
Hello dreamzor:)
What's the code of your object model?