示例#1
0
        public TaggedXmlDoc Patch(XmlDiff patch)
        {
            // tag source document using XPath selectors
            var tagged = new TaggedXmlDoc(doc, patch.Selector);

            // apply modifications
            foreach (var mod in patch.Modifications)
            {
                var element = tagged.FindById(mod.NodeId);
                if (element != null)
                {
                    element.ApplyModification(mod);
                }
            }

            // strip identifiers
            tagged.StripIds();

            return(tagged);
        }
示例#2
0
 public XmlDiff Diff(TaggedXmlDoc original)
 {
     return(new XmlDiff(original.Root.Diff(doc.DocumentElement)));
 }