Example #1
0
        public void ProcessRequest(HttpContext AContext)
        {
            AContext.Response.ContentType = FrontendUtility.CXmlContentType;

            // Read the DILX content
            DilxDocument LDocument = new DilxDocument();

            LDocument.Read(AContext.Request.InputStream);

            // Prepare ancestors
            XmlDocument LMergedAncestors = DilxUtility.MergeAncestors(null, LDocument.Ancestors, AContext);

            // Write DIL
            LMergedAncestors.Save(AContext.Response.OutputStream);

            AContext.Response.End();
        }
Example #2
0
        public void Process(Stream ASource, Stream ATarget, HttpContext AContext)
        {
            DilxDocument LDocument = new DilxDocument();

            LDocument.Read(ASource);

            // Prepare ancestors
            XmlDocument LMergedAncestors = DilxUtility.MergeAncestors(null, LDocument.Ancestors, AContext);

            // Prepare current
            XmlDocument LCurrent = new XmlDocument();

            LCurrent.Load(LDocument.Content);

            //Perform the diff
            LDocument.Content.SetLength(0);
            Inheritance.Diff(LMergedAncestors, LCurrent).Save(LDocument.Content);
            LDocument.Write(ATarget);
        }
Example #3
0
        public void Process(Stream ASource, Stream ATarget, HttpContext AContext)
        {
            // Read the document
            DilxDocument LDocument = new DilxDocument();

            LDocument.Read(ASource);

            // Process ancestors
            XmlDocument LCurrent = DilxUtility.MergeAncestors(null, LDocument.Ancestors, AContext);

            // Process content
            if (LCurrent == null)
            {
                StreamUtility.CopyStream(LDocument.Content, ATarget);
            }
            else
            {
                XmlDocument LMerge = new XmlDocument();
                LMerge.Load(LDocument.Content);
                LCurrent = Inheritance.Merge(LCurrent, LMerge);
                LCurrent.Save(ATarget);
            }
        }