Groups | Blog | Home
all groups > dotnet xml > april 2004 >

dotnet xml : Serializing XmlNamespaceManager


Dan via .NET 247
4/29/2004 5:50:56 PM
Hi All,

Is it possible to serialize an instance of XmlNamespaceManager? =
I'd like to use it to manage a collection of namespaces and save=
that collection for later use but when attempting to serialize=
it, I get an error message indicating that XmlNamespaceManager=
is not serializable=2E

'The type System=2EXml=2EXmlNamespaceManager in Assembly System=2EXml,=
=2E=2E=2E is not marked as serializable=2E'

Is there a way to make a class like XmlNamespaceManager=
serializable?

Thanks,
Dan

-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)

Christoph Schittko [MVP]
4/29/2004 10:14:54 PM
You can have the formatter call your serialization routine by registering a
SerializationSurrogate. See [0] for more info and sample code.

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[0] http://www.topxml.com/xmlserializer/serializationsurrogate.asp

[quoted text, click to view]
Hi All,

Is it possible to serialize an instance of XmlNamespaceManager? I'd like to
use it to manage a collection of namespaces and save that collection for
later use but when attempting to serialize it, I get an error message
indicating that XmlNamespaceManager is not serializable.

'The type System.Xml.XmlNamespaceManager in Assembly System.Xml, ... is not
marked as serializable.'

Is there a way to make a class like XmlNamespaceManager serializable?

Thanks,
Dan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>JecrrEt8OU2lKHc/59hCSQ==</Id>

AddThis Social Bookmark Button