/// <summary>
 /// Goes through the sections in the document and adds them as topics to the collection.
 /// </summary>
 private void AddTopics(Document doc)
 {
     foreach (Section section in doc.Sections)
     {
         try
         {
             Topic topic = new Topic(section, mFixUrl);
             mTopics.Add(topic);
         }
         catch (Exception e)
         {
             // If one topic fails, we continue with others.
             Console.WriteLine(e.Message);
         }
     }
 }
        private static void WriteBookStart(XmlWriter writer, Topic topic)
        {
            writer.WriteStartElement("book");
            writer.WriteAttributeString("name", topic.Title);

            if (!topic.IsHeadingOnly)
                writer.WriteAttributeString("href", topic.FileName);
        }