Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - use section of XML as source/destination of XmlSerializer? >Thread Next - Re: use section of XML as source/destination of XmlSerializer? Re: use section of XML as source/destination of XmlSerializer?To: NULL Date: 3/11/2009 7:32:00 AM On Mar 11, 10:12=A0am, "Craig Buchanan" <some...@microsoft.com> wrote: > I have an Xml file that I use as a database of information about a > manufactures products. =A0It has the format: > > <Manufacturer> > =A0 =A0 <Products> > =A0 =A0 =A0 =A0 <Product id=3D"1" name=3D"product a" price=3D"1.00" /> > =A0 =A0 =A0 =A0 ... > =A0 =A0 </Products> > =A0 =A0 <Suppliers> > =A0 =A0 =A0 =A0 <Supplier id=3D"1" name=3D"supplier x" /> > =A0 =A0 =A0 =A0 ... > =A0 =A0 </Suppliers> > </Manufacturer> > > I would like to be able to use the Suppliers node as the source for the > XmlSerializer's Deserialize and Serialize methods. =A0I figure that I can= load > an XmlDocument, then select the Suppliers node using an Xpath query > (//Supplers). =A0The question is how to send this to the XmlSerialier. > Moreover, what approach should it take for the serialization? > I'm guessing that getting the path from an XmlDocument object will work just fine but that is the only thing you are going to be able to use it for. May as well dispose that object after getting the path from it. Of course, this only applies to Deserializing the object. You will not need the XmlDocument to Serialze, as the path will be in the object already, right? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
