public string[] Update(XmlWriter writer, string xml, ISerializerHost host = null)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(xml);
            NamespaceUpdater namespaceUpdater = new NamespaceUpdater();

            string[] result = namespaceUpdater.Update(xmlDocument, host);
            xmlDocument.Save(writer);
            return(result);
        }
Exemplo n.º 2
0
        public void Serialize(XmlWriter writer, object root)
        {
            XmlDocument    xmlDocument    = new XmlDocument();
            XPathNavigator xPathNavigator = xmlDocument.CreateNavigator();

            using (XmlWriter xmlWriter = xPathNavigator.AppendChild())
            {
                xmlWriter.WriteStartDocument();
                this.WriteObject(xmlWriter, root, null, null, null, 0);
                xmlWriter.WriteEndDocument();
            }
            NamespaceUpdater namespaceUpdater = new NamespaceUpdater();

            namespaceUpdater.Update(xmlDocument, base.Host);
            xmlDocument.Save(writer);
        }