Blog de Francisco Velázquez

otro blog personal

Deserializar en C# ignorando DTD

leave a comment »

        public static object Deserialize(System.Type type, string data)
        {
            XmlSerializer xmlSerializer = new XmlSerializer(type);
            TextReader textReader = new StringReader(data);
            XmlReaderSettings settings = new XmlReaderSettings();
            settings.ProhibitDtd = false;
            settings.XmlResolver = null;
            XmlReader xmlReader = XmlTextReader.Create(textReader, settings);
            return xmlSerializer.Deserialize(xmlReader);
        }

Written by fravelgue

June 8, 2011 at 9:48 am

Posted in development

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: