[mapguide-users] MgByteReader and XmlSerializer question

Maksim Sestic max at geoinova.com
Mon Oct 8 08:58:16 EDT 2007


Is it possible to use System.Xml.Serialization.XmlSerializer class to
instantiate actual type returned as XML by MgByteReader.ToString function? I
see people are using DOM to iterate through resulting XML and I simply can't
get why, since there are specific OSGeo.MapGuide type definitions.
Deserialization should go like:

(prepare m_MemoryStream out of MgResourceService.EnumerateResources...)

Dim m_Maps As MgMapCollection
Dim m_XmlSerializer As XmlSerializer = New
XmlSerializer(GetType(MgMapCollection))
m_Maps = CType(m_XmlSerializer.Deserialize(m_MemoryStream), MgMapCollection)
For Each m_Map As MgMap In m_Maps
   Console.WriteLine(m_Map.Name)
Next

Or am I missing something?

Regards,
Maksim Sestic
-- 
View this message in context: http://www.nabble.com/MgByteReader-and-XmlSerializer-question-tf4587994s16610.html#a13095987
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list