public void SetUp()
        {
            federation = WikiTestUtilities.SetupFederation("test://NamespaceManagerTests",
              TestContentSets.SingleEmptyNamespace);
            testApp = (IMockWikiApplication)federation.Application;

            NamespaceManager manager = federation.NamespaceManagerForNamespace("NamespaceOne");

            testApp.SetApplicationProperty("DisableNewParser", false);
            testApp.SetApplicationProperty("EnableNewParser", true);
            parser = new ParserEngine(federation);
        }
Example #2
0
 public ParserContext(string womElement, ParserEngine engine, bool ignoreCase)
 {
     _ignoreCase = false;
     _womElement = womElement;
     _regExpStr = new StringBuilder();
     _regExp = null;
     _engine = engine;
     _grammar = new GrammarDocument(_engine.GetMainPath);
     _ruleList = new ParserRuleList();
     _parentRule = null;
     _grammar.ReadRules(this);
 }
Example #3
0
 public ParserContext(string womElement, ParserEngine engine, ParserRule rule, string filename)
 {
     _womElement = womElement;
     _ignoreCase = rule.ParentContext.IgnoreCase;
     _regExpStr = new StringBuilder();
     _regExp = null;
     _engine = engine;
     _grammar = new GrammarDocument(filename);
     _ruleList = new ParserRuleList();
     _parentRule = rule;
     AddParentRule(rule);
     _grammar.ReadRules(this);
 }
Example #4
0
 public ParserContext(string womElement, ParserEngine engine, ParserRule rule)
 {
     if (!String.IsNullOrEmpty(womElement))
     {
         _womElement = womElement;
     }
     else
     {
         _womElement = rule.WomElement;
     }
     _ignoreCase = rule.ParentContext.IgnoreCase;
     _regExpStr = new StringBuilder();
     _regExp = null;
     _engine = engine;
     _ruleList = new ParserRuleList();
     _parentRule = rule;
     AddParentRule(rule);
 }
Example #5
0
        public void SetUp()
        {
            MockWikiApplication application = new MockWikiApplication(new FederationConfiguration(),
                new LinkMaker("test://FileSystemStoreTests/"), OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            federation = new Federation(application);
            _fileSystem = new MockFileSystem(
                new MockDirectory(@"C:\",
                    new MockDirectory("flexwiki",
                        new MockDirectory("namespaces",
                            new MockDirectory("namespaceone",
                                new MockFile(@"TopicOne.wiki", new DateTime(2004, 10, 28), @"This is some content"),
                                new MockFile(@"TopicTwo.wiki", new DateTime(2004, 10, 29), @"This is some other content"),
                                new MockFile(@"MULTIcapsGoodTopic.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),

                                new MockFile(@"HomePage.wiki", new DateTime(2004, 10, 30), @"Home page."),
                                new MockFile(@"HomePage(2003-11-24-20-31-20-WINGROUP-davidorn).awiki",
                                    new DateTime(2004, 10, 31), @"Old home page."),

                                new MockFile(@"CodeImprovementIdeas.wiki", new DateTime(2004, 11, 10), @"Latest"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-03-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 09), @"Latest"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 08), @"Older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 07), @"Still older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-06.1-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 06), @"Even older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-07-Name).awiki",
                                    new DateTime(2004, 11, 05), @"Really old"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-08.123-Name).awiki",
                                    new DateTime(2004, 11, 04), @"Oldest"),

                                new MockFile(@"TestDeleteHistory.wiki", new DateTime(2004, 11, 10), @"Latest"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-03-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 09), @"Latest"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 08), @"Older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 07), @"Still older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-06.1-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 06), @"Even older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-07-Name).awiki",
                                    new DateTime(2004, 11, 05), @"Really old"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-08.123-Name).awiki",
                                    new DateTime(2004, 11, 04), @"Oldest"),

                                new MockFile(@"ReadOnlyTopic.wiki",
                                    new DateTime(2004, 11, 05), @"", MockTopicStorePermissions.ReadOnly),
                                new MockFile(@"ReadOnlyTopic(2004-11-05-00-00-00-Name).awiki",
                                    new DateTime(2004, 11, 05), @""),
                                new MockFile(@"ReadOnlyTopic2.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),
                                new MockFile(@"ReadWriteTopic.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadWrite, false),

                                new MockFile(@"DeletedTopic(2004-11-11-00-00-00-Name).awiki",
                                    new DateTime(2004, 11, 11), @"This topic was deleted.")
                             )
                         )
                     )
                 )
             );

            federation.RegisterNamespace(new FileSystemStore(_fileSystem), "NamespaceOne",
                new NamespaceProviderParameterCollection(
                    new NamespaceProviderParameter("Root", Root)));

            // Necessary to bypass security because a non-existent manager can't be
            // retrieved directly from the federation
            manager = WikiTestUtilities.GetNamespaceManagerBypassingSecurity(federation, "NamespaceOne");

            _provider = (FileSystemStore)manager.GetProvider(typeof(FileSystemStore));

            IMockWikiApplication setApp = (IMockWikiApplication)Federation.Application;
            setApp.SetApplicationProperty("DisableNewParser", false);
            setApp.SetApplicationProperty("EnableNewParser", true);
            parser = new ParserEngine(federation);
            //Necessary to init WikiInputDocument for all WomDocument tests
            //inputDoc = parser.InitWikiDocument(Path.Combine(mockapp.WebPath, @"InputDocs/AstralisLux.wiki"));
        }
Example #6
0
 private void Initialize()
 {
     _engine = this;
 }
Example #7
0
 ///// <summary>
 ///// Create a new formatter for a string of input content.
 ///// </summary>
 ///// <param name="source">Input wiki string</param>
 ///// <param name="output">Output object to which output is sent</param>
 ///// <param name="namespaceManager">The ContentProviderChain that contains the wiki string text</param>
 ///// <param name="maker">A link maker </param>
 ///// <param name="external">External wiki map</param>
 ///// <param name="headingLevelBase">Relative heading level</param>
 ///// 
 //Formatter(QualifiedTopicRevision topic, string source, WikiOutput output, NamespaceManager namespaceManager,
 //    LinkMaker maker, ExternalReferencesMap external, int headingLevelBase)
 //{
 //    _topic = topic;
 //    _source = SplitStringIntoStyledLines(source, LineStyle.Unchanged);
 //    _linkMaker = maker;
 //    NamespaceManager = namespaceManager;
 //    _output = output;
 //    _externalWikiMap = external;
 //    _headingLevelBase = headingLevelBase;
 //}
 ///// <summary>
 ///// Create a new formatter for an input list of StyledLines
 ///// </summary>
 ///// <param name="source">Input wiki content as a list of StyledLines</param>
 ///// <param name="output">Output object to which output is sent</param>
 ///// <param name="namespaceManager">The ContentProviderChain that contains the wiki string text</param>
 ///// <param name="maker">A link maker </param>
 ///// <param name="external">External wiki map</param>
 ///// <param name="headingLevelBase">Relative heading level</param>
 ///// 
 //Formatter(QualifiedTopicRevision topic, IList source, WikiOutput output, NamespaceManager namespaceManager,
 //    LinkMaker maker, ExternalReferencesMap external, int headingLevelBase)
 //{
 //    _topic = topic;
 //    _source = source;
 //    _output = output;
 //    _linkMaker = maker;
 //    NamespaceManager = namespaceManager;
 //    _externalWikiMap = external;
 //    _headingLevelBase = headingLevelBase;
 //}
 public ParserEngine(Federation fed)
 {
     Initialize();
     if ((bool)fed.Application["DisableNewParser"])
     {
         _engine = this;
     }
     else
     {
         if (fed.Application.ExecutionEnvironment == ExecutionEnvironment.Production)
         {
             _appPath = fed.Application.ResolveRelativePath("admin");
         }
         else
         {
             _appPath = System.Environment.CurrentDirectory;
             _appPath = System.IO.Path.Combine(_appPath, @"..\..\..\FlexWiki.Web\admin");
         }
         _fed = fed;
         Regex.CacheSize = 250;
         _context = new ParserContext("WikiText", this, false);
         //_xslt = new XslCompiledTransform(true); //debug enabled for stylesheet during development
         _xslt = new XslCompiledTransform();
         _xslt.Load(XsltPath);
         _processBehaviorToText = false;
     }
 }
Example #8
0
        public void BuildFeed()
        {
            QualifiedTopicRevision topic = GetTopicVersionKey();
            NamespaceManager storeManager = Federation.NamespaceManagerForTopic(topic);
            LinkMaker lm = TheLinkMaker;

            ArrayList entryList = new ArrayList();
            StringBuilder feed = new StringBuilder();
            StringBuilder errFeed = new StringBuilder();
            StringBuilder errEntry = new StringBuilder();
            bool feedInit = false;
            bool feedError = false;
            bool entryError = false;
            string author = "";
            string feedTitle = "";
            string feedUUID = "";
            string feedLogo = "";
            string feedIcon= "";
            string blogCategory ="";

            feed.AppendLine(@"<?xml version=""1.0"" encoding=""utf-8""?>");
            feed.AppendLine(@"<!DOCTYPE message [");
            feed.AppendLine("<!ENTITY nbsp \"&#160;\"> ]>");
            feed.AppendLine(@"<feed xmlns=""http://www.w3.org/2005/Atom"">");

            errFeed.AppendLine(@"<pre id=""Error"" class=""Error"" style=""background: #F00;"">");
            errFeed.AppendLine("The Feed errors described below need to be corrected");

            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("Title"))
            {
                feedTitle = storeManager.GetTopicProperty(topic.LocalName, "Title").LastValue;
            }
            else
            {
                feedError = true;
            }
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("Creator"))
            {
                author = storeManager.GetTopicProperty(topic.LocalName, "Creator").LastValue;
            }
            string feedLink = BaseUrl + lm.LinkToTopic(topic);
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("FeedUUID"))
            {
                feedUUID = storeManager.GetTopicProperty(topic.LocalName, "FeedUUID").LastValue;
            }
            else
            {
                feedError = true;
            }
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("FeedLogo"))
            {
                feedLogo = storeManager.GetTopicProperty(topic.LocalName, "FeedLogo").LastValue;
            }
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("FeedIcon"))
            {
                feedIcon = storeManager.GetTopicProperty(topic.LocalName, "FeedIcon").LastValue;
            }
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("BlogCategory"))
            {
                blogCategory = storeManager.GetTopicProperty(topic.LocalName, "BlogCategory").LastValue;
            }
            if (storeManager.GetTopicInfo(topic.LocalName).HasProperty("BlogTopics"))
            {
                entryList = storeManager.GetTopicInfo(topic.LocalName).GetListProperty("BlogTopics");
            }

            ParserEngine _parser = new ParserEngine(storeManager.Federation);

            errEntry.AppendLine(@"<pre id=""Error"" class=""Error"" style=""background: #F00;"">");
            errEntry.AppendLine("The Entry errors described below need to be corrected");

            if (entryList.Count > 0)
            {
                foreach (string entryTopicName in entryList)
                {
                    string entryTitle = "";
                    string entryAuthor = "";
                    string entryLink = "";
                    string entryUUID = "";
                    string entryContent = "";

                    System.DateTime lastModified = new DateTime();
                    QualifiedTopicRevision entryTopicRev = new QualifiedTopicRevision(entryTopicName, storeManager.Namespace);
                    TopicVersionInfo topicVerInfo = new TopicVersionInfo(storeManager.Federation, entryTopicRev);
                    if (topicVerInfo.Exists)
                    {
                        if (storeManager.GetTopicInfo(entryTopicName).HasProperty("Creator"))
                        {
                            entryAuthor = storeManager.GetTopicProperty(entryTopicName, "Creator").LastValue;
                            if (String.IsNullOrEmpty(author))
                            {
                                author = entryAuthor;
                            }
                        }
                        else
                        {
                            if (!String.IsNullOrEmpty(author))
                            {
                                entryAuthor = author;
                            }
                            else
                            {
                                feedError = true;
                                errFeed.AppendLine(" Error: The feed does not have a property named 'Creator' or the property does not contain a value.");
                                author = "Author Unspecified";
                                entryAuthor = author;
                            }
                        }

                        if (storeManager.GetTopicInfo(entryTopicName).HasProperty("Title"))
                        {
                            entryTitle = storeManager.GetTopicProperty(entryTopicName, "Title").LastValue;
                        }
                        else
                        {
                            entryTitle = storeManager.GetTopicInfo(entryTopicName).ExposedFormattedName;
                        }
                        lastModified = storeManager.GetTopicLastModificationTime(entryTopicName).ToUniversalTime();

                        if (!feedInit)
                        {
                            if (feedError)
                            {
                                feedError = true;
                                if (entryList.Count == 0)
                                {
                                    errFeed.AppendLine("Error: Feed does not have a property 'BlogTopics' or that property value is empty");
                                }
                                if (!String.IsNullOrEmpty(feedTitle))
                                {
                                    feed.AppendFormat(@"<title>{0}</title>", feedTitle);
                                }
                                else
                                {
                                    feed.AppendLine("<title>Feed title Unspecified</title>");
                                    errFeed.AppendLine("Error: Feed does not have a property 'Title' or value is empty.");
                                }
                                feed.AppendLine(@"<author>");
                                feed.AppendFormat(@"<name>{0}</name>", author);
                                feed.AppendLine(@"</author>");
                                if (!String.IsNullOrEmpty(feedUUID))
                                {
                                    feed.AppendFormat(@"<id>urn:uuid:{0}</id>", feedUUID);
                                }
                                else
                                {
                                    feed.AppendFormat(@"<id>urn:uuid:{0}</id>", System.Guid.NewGuid().ToString());
                                    errFeed.AppendLine("Error: Feed does not have a property 'FeedUUID' or value is empty. A temporary value has been assigned");
                                }
                                feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                                if (!String.IsNullOrEmpty(feedLogo))
                                {
                                    feed.AppendFormat(@"<logo>{0}</logo>", feedLogo);
                                }
                                if (!String.IsNullOrEmpty(feedIcon))
                                {
                                    feed.AppendFormat(@"<icon>{0}</icon>", feedIcon);
                                }
                                if (!String.IsNullOrEmpty(blogCategory))
                                {
                                    feed.AppendFormat(@"<category term=""{0}"" />", blogCategory);
                                }
                                errFeed.AppendLine("</pre>");

                            }
                            else
                            {
                                feed.AppendFormat(@"<title>{0}</title>", feedTitle);
                                feed.AppendFormat(@"<link href=""{0}"" rel=""self"" type=""application/atom+xml"" />", feedLink);
                                feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                                feed.AppendFormat(@"<icon>{0}</icon>", feedIcon);
                                feed.AppendFormat(@"<logo>{0}</logo>", feedLogo);
                                feed.AppendLine(@"<author>");
                                feed.AppendFormat(@"<name>{0}</name>", author);
                                feed.AppendLine(@"</author>");
                                feed.AppendFormat(@"<id>urn:uuid:{0}</id>", feedUUID);
                                if (!String.IsNullOrEmpty(blogCategory))
                                {
                                    feed.AppendFormat(@"<category term=""{0}"" />", blogCategory);
                                }
                            }
                            feedInit = true;
                        }
                        if (storeManager.GetTopicInfo(entryTopicName).HasProperty("EntryUUID"))
                        {
                            entryUUID = storeManager.GetTopicProperty(entryTopicName, "EntryUUID").LastValue;
                        }
                        else
                        {
                            entryError = true;
                            entryUUID = System.Guid.NewGuid().ToString();
                            errEntry.AppendLine("Error: Entry does not have a property 'EntryUUID' or value is empty. A temporary value has been assigned");
                        }
                        entryLink = BaseUrl + lm.LinkToTopic(entryTopicRev);
                        errEntry.AppendLine("</pre>");

                        string body = storeManager.GetTopicInfo(entryTopicName).GetProperty("_Body").ToString();
                        WomDocument xmldoc = new WomDocument(null);
                        xmldoc = _parser.FormatTextFragment(body, entryTopicRev, storeManager, true, 600);
                        xmldoc.ParsedDocument = @"<?xml version=""1.0"" encoding=""utf-8""?>
            <!DOCTYPE message [
            <!ENTITY nbsp ""&#160;""> ]>
             <div id=""womDocRoot"">" + xmldoc.ParsedDocument + "</div>";
                        entryContent = _parser.WikiToPresentation(xmldoc.XmlDoc);
                        //string entryContent = Formatter.FormattedTopic(entryTopicRev, OutputFormat.HTML, null, storeManager.Federation, lm);
                        feed.AppendLine(@"<entry>");
                        feed.AppendFormat(@"<title>{0}</title>", entryTitle);
                        feed.AppendFormat(@"<link href=""{0}"" />", entryLink);
                        feed.AppendFormat(@"<id>urn:uuid:{0}</id>", entryUUID);
                        feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                        //feed.AppendLine(@"<content>");
                        feed.AppendLine(@"<content type=""xhtml"">");
                        feed.AppendLine(@"<div xmlns=""http://www.w3.org/1999/xhtml"">");
                        if (feedError)
                        {
                            feed.Append(errFeed.ToString());
                        }
                        if (entryError)
                        {
                            feed.Append(errEntry.ToString());
                        }
                        feed.Append(entryContent);
                        feed.AppendLine("</div>");
                        feed.AppendLine("</content>");
                        if (storeManager.GetTopicInfo(entryTopicName).HasProperty("Keywords"))
                        {
                            ArrayList keywordsList = storeManager.GetTopicInfo(entryTopicName).KeywordsList;
                            foreach (string keyword in keywordsList)
                            {
                                feed.AppendFormat(@"<category term=""{0}"" />", keyword);
                            }
                        }

                        feed.AppendLine("</entry>");
                    }
                    else
                    {
                        entryError = true;
                        errEntry.AppendLine("Error: The topic specified in the property 'BlogContents' does not exist.");
                        if (feedError)
                        {
                            feedError = true;
                            if (entryList.Count == 0)
                            {
                                errFeed.AppendLine("Error: Feed does not have a property 'BlogTopics' or that property value is empty");
                            }
                            if (!String.IsNullOrEmpty(feedTitle))
                            {
                                feed.AppendFormat(@"<title>{0}</title>", feedTitle);
                            }
                            else
                            {
                                feed.AppendLine("<title>Feed title Unspecified</title>");
                                errFeed.AppendLine("Error: Feed does not have a property 'Title' or value is empty.");
                            }
                            if (!String.IsNullOrEmpty(author))
                            {
                                feed.AppendLine(@"<author>");
                                feed.AppendFormat(@"<name>{0}</name>", author);
                                feed.AppendLine(@"</author>");
                            }
                            else
                            {
                                feed.AppendLine(@"<author>");
                                feed.AppendFormat(@"<name>{0}</name>", "Author Unspecified");
                                feed.AppendLine(@"</author>");
                                errFeed.AppendLine("Error: Feed does not have a property 'Creator' or value is empty. This may occur as there was no valid entry found to provide a 'Creator' property.");
                            }
                            if (!String.IsNullOrEmpty(feedUUID))
                            {
                                feed.AppendFormat(@"<id>urn:uuid:{0}</id>", feedUUID);
                            }
                            else
                            {
                                feed.AppendFormat(@"<id>urn:uuid:{0}</id>", System.Guid.NewGuid().ToString());
                                errFeed.AppendLine("Error: Feed does not have a property 'FeedUUID' or value is empty. A temporary value has been assigned");
                            }
                            feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                            if (!String.IsNullOrEmpty(feedLogo))
                            {
                                feed.AppendFormat(@"<logo>{0}</logo>", feedLogo);
                            }
                            if (!String.IsNullOrEmpty(feedIcon))
                            {
                                feed.AppendFormat(@"<icon>{0}</icon>", feedIcon);
                            }
                            if (!String.IsNullOrEmpty(blogCategory))
                            {
                                feed.AppendFormat(@"<category term=""{0}"" />", blogCategory);
                            }
                            errFeed.AppendLine("</pre>");

                        }
                        else
                        {
                            feed.AppendFormat(@"<title>{0}</title>", feedTitle);
                            feed.AppendFormat(@"<link href=""{0}"" rel=""self"" type=""application/atom+xml"" />", feedLink);
                            feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                            feed.AppendFormat(@"<icon>{0}</icon>", feedIcon);
                            feed.AppendFormat(@"<logo>{0}</logo>", feedLogo);
                            feed.AppendLine(@"<author>");
                            feed.AppendFormat(@"<name>{0}</name>", author);
                            feed.AppendLine(@"</author>");                 feed.AppendFormat(@"<id>urn:uuid:{0}</id>", feedUUID);

                            if (!String.IsNullOrEmpty(blogCategory))
                            {
                                feed.AppendFormat(@"<category term=""{0}"" />", blogCategory);
                            }
                        }
                        errEntry.AppendLine("</pre>");
                        feed.AppendLine(@"<entry>");
                        feed.AppendFormat(@"<title>{0}</title>", entryTitle);
                        feed.AppendFormat(@"<link href=""{0}"" />", entryLink);
                        feed.AppendFormat(@"<id>urn:uuid:{0}</id>", entryUUID);
                        feed.AppendFormat(@"<updated>{0:s}Z</updated>", lastModified);
                        //feed.AppendLine(@"<content>");
                        feed.AppendLine(@"<content type=""xhtml"">");
                        feed.AppendLine(@"<div xmlns=""http://www.w3.org/1999/xhtml"">");
                        if (feedError)
                        {
                            feed.Append(errFeed.ToString());
                        }
                        if (entryError)
                        {
                            feed.Append(errEntry.ToString());
                        }
                        feed.Append(entryContent);
                        feed.AppendLine("</div>");
                        feed.AppendLine("</content>");
                        if (storeManager.GetTopicInfo(entryTopicName).HasProperty("Keywords"))
                        {
                            ArrayList keywordsList = storeManager.GetTopicInfo(entryTopicName).KeywordsList;
                            foreach (string keyword in keywordsList)
                            {
                                feed.AppendFormat(@"<category term=""{0}"" />", keyword);
                            }
                        }

                        feed.AppendLine("</entry>");

                    }   //end topicVerInfo does not exist
                }
            }
            else
            {
                feedError = true;
                if (entryList.Count == 0)
                {
                    errFeed.AppendLine("Error: Feed does not have a property 'BlogTopics' or that property value is empty");
                }
                if (!String.IsNullOrEmpty(feedTitle))
                {
                    feed.AppendFormat(@"<title>{0}</title>", feedTitle);
                }
                else
                {
                    feed.AppendLine("<title>Feed title Unspecified</title>");
                    errFeed.AppendLine("Error: Feed does not have a property 'Title' or value is empty.");
                }
                if (!String.IsNullOrEmpty(author))
                {
                    feed.AppendLine(@"<author>");
                    feed.AppendFormat(@"<name>{0}</name>", author);
                    feed.AppendLine(@"</author>");
                }
                else
                {
                    feed.AppendLine(@"<author>");
                    feed.AppendFormat(@"<name>{0}</name>", "Author Unspecified");
                    feed.AppendLine(@"</author>");
                    errFeed.AppendLine("Error: Feed does not have a property 'Creator' or value is empty. This may occur as there was no valid entry found to provide a 'Creator' property.");
                }
                if (!String.IsNullOrEmpty(feedUUID))
                {
                    feed.AppendFormat(@"<id>urn:uuid:{0}</id>", feedUUID);
                }
                else
                {
                    feed.AppendFormat(@"<id>urn:uuid:{0}</id>", System.Guid.NewGuid().ToString());
                    errFeed.AppendLine("Error: Feed does not have a property 'FeedUUID' or value is empty. A temporary value has been assigned");
                }
                feed.AppendFormat(@"<updated>{0:s}Z</updated>", System.DateTime.Now.ToUniversalTime());
                if (!String.IsNullOrEmpty(feedLogo))
                {
                    feed.AppendFormat(@"<logo>{0}</logo>", feedLogo);
                }
                if (!String.IsNullOrEmpty(feedIcon))
                {
                    feed.AppendFormat(@"<icon>{0}</icon>", feedIcon);
                }
                if (!String.IsNullOrEmpty(blogCategory))
                {
                    feed.AppendFormat(@"<category term=""{0}"" />", blogCategory);
                }
                errFeed.AppendLine("</pre>");

                feed.AppendLine(@"<entry>");
                feed.AppendLine(@"<title>Error Information</title>");
                feed.AppendLine(@"<content type=""xhtml"">");
                feed.AppendLine(@"<div xmlns=""http://www.w3.org/1999/xhtml"">");
                feed.Append(errFeed.ToString());
                feed.AppendLine("</div>");
                feed.AppendLine("</content>");
                feed.AppendLine(@"</entry>");
            }
            feed.AppendLine("</feed>");
            Response.Write(feed.ToString());
        }