Exemple #1
0
        public void Load(XmlReader sourceXml, XmlReader diffgram)
        {
            var diffgramDoc = new XmlDocument();

            diffgramDoc.Load(diffgram);
            this.PreprocessDiffgram(diffgramDoc);
            this._doc = new XmlDiffViewDocument();
            this.LoadSourceChildNodes(this._doc, sourceXml, false);
            this.ApplyDiffgram(diffgramDoc.DocumentElement, this._doc);
        }
        public void Load(XmlReader sourceXml, XmlReader diffgram)
        {
            // load diffgram to DOM
            XmlDocument diffgramDoc = new XmlDocument();

            diffgramDoc.Load(diffgram);

            // process operation descriptors
            PreprocessDiffgram(diffgramDoc);

            // load document
            _doc = new XmlDiffViewDocument();
            LoadSourceChildNodes(_doc, sourceXml, false);

            // apply diffgram
            ApplyDiffgram(diffgramDoc.DocumentElement, _doc);
        }
        /// <summary>
        /// Loads the diffgram to an XmlDocument object, and drives the 
        /// process of loading the baseline xml file to a 
        /// XmlDiffViewDocument object, tagging the nodes and attributes
        /// according to the options selected, and finally merges the
        /// diffgram data into the XmlDiffViewDocument object. 
        /// </summary>
        /// <param name="sourceXml">baseline data</param>
        /// <param name="diffgram">diffgram data stream</param>
        public void Load(XmlReader sourceXml, XmlReader diffGram)
        {
            nextOperationId = 1;

            if (null == sourceXml)
            {
                throw new ArgumentNullException("sourceXml");
            }

            if (null == diffGram)
            {
                throw new ArgumentNullException("diffgram");
            }

            // load diffgram to DOM
            XmlDocument diffgramDoc = new XmlDocument();
            diffgramDoc.Load(diffGram);

            // process operation descriptors
            this.PreprocessDiffgram(diffgramDoc);

            // load document
            this.viewDocument = new XmlDiffViewDocument();
            this.LoadSourceChildNodes(this.viewDocument, sourceXml, false);

            // apply diffgram
            this.ApplyDiffgram(diffgramDoc.DocumentElement, this.viewDocument);
        }