Пример #1
0
 protected override void ConvertIframe(HtmlAgilityPack.HtmlNode node, System.Xml.XmlWriter writer)
 {
     using (writer.StartElement("ext-link"))
     {
         writer.WriteAttributeString("xmlns", "xlink", null, node.GetAttributeValue("src", string.Empty));
     }
 }
Пример #2
0
        public void Convert(HtmlAgilityPack.HtmlNode node, System.Xml.XmlWriter writer)
        {
            using (writer.StartElement("p"))
            {
                writer.WriteAttributeString("content-type", "2.2 Story Sub-head 3");

                var innerContent = new ParagraphContent();
                innerContent.Convert(node, writer);
            }
        }
Пример #3
0
        public void Convert(HtmlAgilityPack.HtmlNode node, System.Xml.XmlWriter writer)
        {
            var classOfParagraph = node.GetAttributeValue("class", null);

            if (string.IsNullOrEmpty(classOfParagraph))
            {
                if (!string.IsNullOrEmpty(node.InnerText.Trim()))
                {
                    using (writer.StartElement("p"))
                    {
                        writer.WriteAttributeString("content-type", "2.2 Story Text");

                        var innerContent = new InnerTextNode();
                        innerContent.Convert(node, writer);
                    }
                }
            }
            else if (classOfParagraph.Equals("article-paragraph", StringComparison.CurrentCultureIgnoreCase))
            {
                using (writer.StartElement("p"))
                {
                    writer.WriteAttributeString("content-type", "2.2 Story Text");

                    var innerContent = new InnerTextNode();
                    innerContent.Convert(node, writer);
                }
            }
            else if (classOfParagraph.Equals("nomargin", StringComparison.CurrentCultureIgnoreCase))
            {
                using (writer.StartElement("p"))
                {
                    writer.WriteAttributeString("content-type", "2.25 Story Text - No Spacing");

                    var innerContent = new InnerTextNode();
                    innerContent.Convert(node, writer);
                }
            }
            else if (classOfParagraph.Equals("exhibitnumber", StringComparison.CurrentCultureIgnoreCase))
            {
                // exhibit numbers are handled by the image/table.
                return;
            }
            else if (classOfParagraph.Equals("exhibittitle", StringComparison.CurrentCultureIgnoreCase))
            {
                // exhibit titles are handled by the image/table.
                return;
            }
            else if (classOfParagraph.Equals("source", StringComparison.CurrentCultureIgnoreCase))
            {
                // sources are handled by the image/table.
                return;
            }
            else if (classOfParagraph.Equals("question", StringComparison.CurrentCultureIgnoreCase))
            {
                var interviewQuestion = new InterviewQuestionNode();
                interviewQuestion.Convert(node, writer);
            }
            else if (classOfParagraph.Equals("answer", StringComparison.CurrentCultureIgnoreCase))
            {
                var interviewAnswer = new InterviewAnswerNode();
                interviewAnswer.Convert(node, writer);
            }
            else if (classOfParagraph.Equals("CompanyName", StringComparison.CurrentCultureIgnoreCase))
            {
                var companyName = new CompanyNameNode();
                companyName.Convert(node, writer);
            }
        }